Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 8101e5e

Browse files
committed
Fix shared model white-space / code formatting
1 parent d4fcf96 commit 8101e5e

28 files changed

+961
-951
lines changed

tests/ServiceStack.OrmLite.Tests/Shared/ApiUtilExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static string PrintLastSql(this IDbConnection dbConn)
1313
"".Print();
1414
return dbConn.GetLastSql();
1515
}
16-
16+
1717
//[Explicit]
1818
//public void Benchmark()
1919
//{

tests/ServiceStack.OrmLite.Tests/Shared/BuiltInsFactory.cs

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,52 @@
44

55
namespace ServiceStack.Common.Tests.Models
66
{
7-
public class BuiltInsFactory
8-
: ModelFactoryBase<string>
9-
{
10-
readonly string[] StringValues = new[] {
11-
"one", "two", "three", "four",
12-
"five", "six", "seven"
13-
};
7+
public class BuiltInsFactory
8+
: ModelFactoryBase<string>
9+
{
10+
readonly string[] StringValues = new[] {
11+
"one", "two", "three", "four",
12+
"five", "six", "seven"
13+
};
1414

15-
public override void AssertIsEqual(string actual, string expected)
16-
{
17-
Assert.That(actual, Is.EqualTo(expected));
18-
}
15+
public override void AssertIsEqual(string actual, string expected)
16+
{
17+
Assert.That(actual, Is.EqualTo(expected));
18+
}
1919

20-
public override string CreateInstance(int i)
21-
{
22-
return i < StringValues.Length
23-
? StringValues[i]
24-
: i.ToString();
25-
}
26-
}
20+
public override string CreateInstance(int i)
21+
{
22+
return i < StringValues.Length
23+
? StringValues[i]
24+
: i.ToString();
25+
}
26+
}
2727

28-
public class IntFactory
29-
: ModelFactoryBase<int>
30-
{
31-
public override void AssertIsEqual(int actual, int expected)
32-
{
33-
Assert.That(actual, Is.EqualTo(expected));
34-
}
28+
public class IntFactory
29+
: ModelFactoryBase<int>
30+
{
31+
public override void AssertIsEqual(int actual, int expected)
32+
{
33+
Assert.That(actual, Is.EqualTo(expected));
34+
}
3535

36-
public override int CreateInstance(int i)
37-
{
38-
return i;
39-
}
40-
}
36+
public override int CreateInstance(int i)
37+
{
38+
return i;
39+
}
40+
}
4141

42-
public class DateTimeFactory
43-
: ModelFactoryBase<DateTime>
44-
{
45-
public override void AssertIsEqual(DateTime actual, DateTime expected)
46-
{
47-
Assert.That(actual, Is.EqualTo(expected));
48-
}
42+
public class DateTimeFactory
43+
: ModelFactoryBase<DateTime>
44+
{
45+
public override void AssertIsEqual(DateTime actual, DateTime expected)
46+
{
47+
Assert.That(actual, Is.EqualTo(expected));
48+
}
4949

50-
public override DateTime CreateInstance(int i)
51-
{
52-
return new DateTime(i, DateTimeKind.Utc);
53-
}
54-
}
50+
public override DateTime CreateInstance(int i)
51+
{
52+
return new DateTime(i, DateTimeKind.Utc);
53+
}
54+
}
5555
}

tests/ServiceStack.OrmLite.Tests/Shared/IModelFactory.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
namespace ServiceStack.Common.Tests.Models
44
{
5-
public interface IModelFactory<T>
6-
{
7-
void AssertListsAreEqual(List<T> actualList, IList<T> expectedList);
8-
void AssertIsEqual(T actual, T expected);
5+
public interface IModelFactory<T>
6+
{
7+
void AssertListsAreEqual(List<T> actualList, IList<T> expectedList);
8+
void AssertIsEqual(T actual, T expected);
99

10-
T ExistingValue { get; }
11-
T NonExistingValue { get; }
12-
List<T> CreateList();
13-
List<T> CreateList2();
14-
T CreateInstance(int i);
15-
}
10+
T ExistingValue { get; }
11+
T NonExistingValue { get; }
12+
List<T> CreateList();
13+
List<T> CreateList2();
14+
T CreateInstance(int i);
15+
}
1616
}

tests/ServiceStack.OrmLite.Tests/Shared/ModelFactoryBase.cs

Lines changed: 53 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,57 @@
33

44
namespace ServiceStack.Common.Tests.Models
55
{
6-
public abstract class ModelFactoryBase<T>
7-
: IModelFactory<T>
8-
{
9-
#region Implementation of IModelFactory<T>
10-
11-
public void AssertListsAreEqual(List<T> actualList, IList<T> expectedList)
12-
{
13-
Assert.That(actualList, Has.Count.EqualTo(expectedList.Count));
14-
var i = 0;
15-
16-
actualList.ForEach(x =>
17-
AssertIsEqual(x, expectedList[i++]));
18-
}
19-
20-
public abstract T CreateInstance(int i);
21-
22-
public abstract void AssertIsEqual(T actual, T expected);
23-
24-
public T ExistingValue
25-
{
26-
get
27-
{
28-
return CreateInstance(4);
29-
}
30-
}
31-
32-
public T NonExistingValue
33-
{
34-
get
35-
{
36-
return CreateInstance(5);
37-
}
38-
}
39-
40-
public List<T> CreateList()
41-
{
42-
return new List<T>
43-
{
44-
CreateInstance(1),
45-
CreateInstance(2),
46-
CreateInstance(3),
47-
CreateInstance(4),
48-
};
49-
}
50-
public List<T> CreateList2()
51-
{
52-
return new List<T>
53-
{
54-
CreateInstance(5),
55-
CreateInstance(6),
56-
CreateInstance(7),
57-
};
58-
}
59-
60-
#endregion
61-
}
6+
public abstract class ModelFactoryBase<T>
7+
: IModelFactory<T>
8+
{
9+
public void AssertListsAreEqual(List<T> actualList, IList<T> expectedList)
10+
{
11+
Assert.That(actualList, Has.Count.EqualTo(expectedList.Count));
12+
var i = 0;
13+
14+
actualList.ForEach(x =>
15+
AssertIsEqual(x, expectedList[i++]));
16+
}
17+
18+
public abstract T CreateInstance(int i);
19+
20+
public abstract void AssertIsEqual(T actual, T expected);
21+
22+
public T ExistingValue
23+
{
24+
get
25+
{
26+
return CreateInstance(4);
27+
}
28+
}
29+
30+
public T NonExistingValue
31+
{
32+
get
33+
{
34+
return CreateInstance(5);
35+
}
36+
}
37+
38+
public List<T> CreateList()
39+
{
40+
return new List<T>
41+
{
42+
CreateInstance(1),
43+
CreateInstance(2),
44+
CreateInstance(3),
45+
CreateInstance(4),
46+
};
47+
}
48+
49+
public List<T> CreateList2()
50+
{
51+
return new List<T>
52+
{
53+
CreateInstance(5),
54+
CreateInstance(6),
55+
CreateInstance(7),
56+
};
57+
}
58+
}
6259
}

tests/ServiceStack.OrmLite.Tests/Shared/ModelWithComplexTypes.cs

Lines changed: 60 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,74 +4,75 @@
44

55
namespace ServiceStack.Common.Tests.Models
66
{
7-
public class ModelWithComplexTypes
8-
{
9-
public ModelWithComplexTypes()
10-
{
11-
this.StringList = new List<string>();
12-
this.IntList = new List<int>();
13-
this.StringMap = new Dictionary<string, string>();
14-
this.IntMap = new Dictionary<int, int>();
15-
}
7+
public class ModelWithComplexTypes
8+
{
9+
public ModelWithComplexTypes()
10+
{
11+
this.StringList = new List<string>();
12+
this.IntList = new List<int>();
13+
this.StringMap = new Dictionary<string, string>();
14+
this.IntMap = new Dictionary<int, int>();
15+
}
1616

17-
public long Id { get; set; }
17+
public long Id { get; set; }
1818

19-
public List<string> StringList { get; set; }
19+
public List<string> StringList { get; set; }
2020

21-
public List<int> IntList { get; set; }
21+
public List<int> IntList { get; set; }
2222

23-
public Dictionary<string, string> StringMap { get; set; }
23+
public Dictionary<string, string> StringMap { get; set; }
2424

25-
public Dictionary<int, int> IntMap { get; set; }
25+
public Dictionary<int, int> IntMap { get; set; }
2626

27-
public ModelWithComplexTypes Child { get; set; }
27+
public ModelWithComplexTypes Child { get; set; }
2828

29-
public static ModelWithComplexTypes Create(int id)
30-
{
31-
var row = new ModelWithComplexTypes {
32-
Id = id,
33-
StringList = { "val" + id + 1, "val" + id + 2, "val" + id + 3 },
34-
IntList = { id + 1, id + 2, id + 3 },
35-
StringMap =
36-
{
37-
{"key" + id + 1, "val" + id + 1},
38-
{"key" + id + 2, "val" + id + 2},
39-
{"key" + id + 3, "val" + id + 3},
40-
},
41-
IntMap =
42-
{
43-
{id + 1, id + 2},
44-
{id + 3, id + 4},
45-
{id + 5, id + 6},
46-
},
47-
Child = new ModelWithComplexTypes { Id = id * 2 },
48-
};
29+
public static ModelWithComplexTypes Create(int id)
30+
{
31+
var row = new ModelWithComplexTypes
32+
{
33+
Id = id,
34+
StringList = { "val" + id + 1, "val" + id + 2, "val" + id + 3 },
35+
IntList = { id + 1, id + 2, id + 3 },
36+
StringMap =
37+
{
38+
{"key" + id + 1, "val" + id + 1},
39+
{"key" + id + 2, "val" + id + 2},
40+
{"key" + id + 3, "val" + id + 3},
41+
},
42+
IntMap =
43+
{
44+
{id + 1, id + 2},
45+
{id + 3, id + 4},
46+
{id + 5, id + 6},
47+
},
48+
Child = new ModelWithComplexTypes { Id = id * 2 },
49+
};
4950

50-
return row;
51-
}
51+
return row;
52+
}
5253

53-
public static ModelWithComplexTypes CreateConstant(int i)
54-
{
55-
return Create(i);
56-
}
54+
public static ModelWithComplexTypes CreateConstant(int i)
55+
{
56+
return Create(i);
57+
}
5758

58-
public static void AssertIsEqual(ModelWithComplexTypes actual, ModelWithComplexTypes expected)
59-
{
60-
Assert.That(actual.Id, Is.EqualTo(expected.Id));
61-
Assert.That(actual.StringList, Is.EquivalentTo(expected.StringList));
62-
Assert.That(actual.IntList, Is.EquivalentTo(expected.IntList));
63-
Assert.That(actual.StringMap, Is.EquivalentTo(expected.StringMap));
64-
Assert.That(actual.IntMap, Is.EquivalentTo(expected.IntMap));
59+
public static void AssertIsEqual(ModelWithComplexTypes actual, ModelWithComplexTypes expected)
60+
{
61+
Assert.That(actual.Id, Is.EqualTo(expected.Id));
62+
Assert.That(actual.StringList, Is.EquivalentTo(expected.StringList));
63+
Assert.That(actual.IntList, Is.EquivalentTo(expected.IntList));
64+
Assert.That(actual.StringMap, Is.EquivalentTo(expected.StringMap));
65+
Assert.That(actual.IntMap, Is.EquivalentTo(expected.IntMap));
6566

66-
if (expected.Child == null)
67-
{
68-
Assert.That(actual.Child, Is.Null);
69-
}
70-
else
71-
{
72-
Assert.That(actual.Child, Is.Not.Null);
73-
AssertIsEqual(actual.Child, expected.Child);
74-
}
75-
}
76-
}
67+
if (expected.Child == null)
68+
{
69+
Assert.That(actual.Child, Is.Null);
70+
}
71+
else
72+
{
73+
Assert.That(actual.Child, Is.Not.Null);
74+
AssertIsEqual(actual.Child, expected.Child);
75+
}
76+
}
77+
}
7778
}

0 commit comments

Comments
 (0)