Mercurial > repos > IBDev-IBBoard.WarFoundry.API.Tests
annotate API/Objects/GameSystemTest.cs @ 137:081b48413f6d
Re #140: Add equality methods to WarFoundry objects
* Add equality to Race, GameSystem and UnitType tests
* Create equality test for UnitCountRequirementData
Not all tests pass yet
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 26 Apr 2011 15:03:46 +0000 |
parents | 168c5aab34bb |
children | 2ae80631ec9c |
rev | line source |
---|---|
82
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 using System; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 using NUnit.Framework; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 using IBBoard.WarFoundry.API.Factories; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 using NUnit.Framework.SyntaxHelpers; |
137
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
5 using System.Reflection; |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
6 using IBBoard.NUnit; |
82
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 namespace IBBoard.WarFoundry.API.Objects |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 { |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 [TestFixture()] |
137
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
11 public class GameSystemTest : AbstractEqualityTest<GameSystem> |
82
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 { |
137
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
13 //FIXME We shouldn't duplicate these tests, but it is broken at the moment |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
14 [Test] |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
15 public void TestEquality() |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
16 { |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
17 Assert.AreEqual(GetObject(), GetSameObject()); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
18 Assert.AreEqual(GetSameObject(), GetObject()); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
19 } |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
20 |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
21 [Test] |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
22 public void TestInequality() |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
23 { |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
24 Assert.AreNotEqual(GetObject(), GetDifferentObject()); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
25 Assert.AreNotEqual(GetSameObject(), GetDifferentObject()); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
26 Assert.AreNotEqual(GetDifferentObject(), GetObject()); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
27 Assert.AreNotEqual(GetDifferentObject(), GetSameObject()); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
28 } |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
29 |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
30 [Test] |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
31 public void TestReflexiveEquality() |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
32 { |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
33 Assert.AreEqual(GetObject(), GetObject()); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
34 Assert.AreEqual(GetSameObject(), GetSameObject()); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
35 Assert.AreEqual(GetDifferentObject(), GetDifferentObject()); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
36 } |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
37 |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
38 [Test] |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
39 public void TestOtherInequality() |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
40 { |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
41 MethodInfo[] methodInfo = GetType().GetMethods(); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
42 GameSystem obj = GetObject(); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
43 |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
44 foreach (MethodInfo method in methodInfo) |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
45 { |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
46 if (method.Name.StartsWith("GetOtherDifferent")) |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
47 { |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
48 GameSystem otherObj = (GameSystem)method.Invoke(this, new object[0]); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
49 Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
50 Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
51 } |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
52 } |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
53 } |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
54 |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
55 |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
56 |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
57 |
82
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
58 [Test()] |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
59 public void TestPointsSingularAbbreviation () |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
60 { |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
61 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
62 Assert.That(system.GetPointsAbbrev(1), Is.EqualTo("")); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
63 system.SystemPtsAbbrevSingle = "pt"; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
64 system.SystemPtsAbbrevPlural = "pts"; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
65 Assert.That(system.GetPointsAbbrev(1), Is.EqualTo("pt")); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
66 } |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
67 |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
68 [Test()] |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
69 public void TestPointsPluralAbbreviation () |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
70 { |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
71 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
72 Assert.That(system.GetPointsAbbrev(2), Is.EqualTo("")); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
73 system.SystemPtsAbbrevSingle = "pt"; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
74 system.SystemPtsAbbrevPlural = "pts"; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
75 Assert.That(system.GetPointsAbbrev(2), Is.EqualTo("pts")); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
76 } |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
77 |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
78 [Test()] |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
79 public void TestPointsZeroAbbreviation () |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
80 { |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
81 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
82 Assert.That(system.GetPointsAbbrev(0), Is.EqualTo("")); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
83 system.SystemPtsAbbrevSingle = "pt"; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
84 system.SystemPtsAbbrevPlural = "pts"; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
85 Assert.That(system.GetPointsAbbrev(0), Is.EqualTo("pts")); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
86 } |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
87 |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
88 [Test()] |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
89 public void TestPointsSingularName () |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
90 { |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
91 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
92 Assert.That(system.GetPointsName(1), Is.EqualTo("")); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
93 system.SystemPtsNameSingle = "pt"; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
94 system.SystemPtsNamePlural = "pts"; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
95 Assert.That(system.GetPointsName(1), Is.EqualTo("pt")); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
96 } |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
97 |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
98 [Test()] |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
99 public void TestPointsPluralName () |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
100 { |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
101 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
102 Assert.That(system.GetPointsName(2), Is.EqualTo("")); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
103 system.SystemPtsNameSingle = "pt"; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
104 system.SystemPtsNamePlural = "pts"; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
105 Assert.That(system.GetPointsName(2), Is.EqualTo("pts")); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
106 } |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
107 |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
108 [Test()] |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
109 public void TestPointsZeroName () |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
110 { |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
111 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
112 Assert.That(system.GetPointsName(0), Is.EqualTo("")); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
113 system.SystemPtsNameSingle = "pt"; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
114 system.SystemPtsNamePlural = "pts"; |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
115 Assert.That(system.GetPointsName(0), Is.EqualTo("pts")); |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
116 } |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
117 |
84
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
118 [Test()] |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
119 public void TestPointsSingularNameFallsBackToPlural () |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
120 { |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
121 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
122 Assert.That(system.GetPointsName(1), Is.EqualTo("")); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
123 system.SystemPtsNamePlural = "pts"; |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
124 Assert.That(system.GetPointsName(1), Is.EqualTo("pts")); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
125 } |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
126 |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
127 [Test()] |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
128 public void TestPointsPluralNameFallsBackToSingular () |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
129 { |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
130 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
131 Assert.That(system.GetPointsName(2), Is.EqualTo("")); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
132 system.SystemPtsNameSingle = "pt"; |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
133 Assert.That(system.GetPointsName(2), Is.EqualTo("pt")); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
134 } |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
135 |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
136 [Test()] |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
137 public void TestPointsZeroNameFallsBackToSingular () |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
138 { |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
139 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
140 Assert.That(system.GetPointsName(0), Is.EqualTo("")); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
141 system.SystemPtsNameSingle = "pt"; |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
142 Assert.That(system.GetPointsName(0), Is.EqualTo("pt")); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
143 } |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
144 |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
145 [Test()] |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
146 public void TestPointsSingularAbbreviationFallsBackToPlural () |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
147 { |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
148 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
149 Assert.That(system.GetPointsAbbrev(1), Is.EqualTo("")); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
150 system.SystemPtsAbbrevPlural = "pts"; |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
151 Assert.That(system.GetPointsAbbrev(1), Is.EqualTo("pts")); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
152 } |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
153 |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
154 [Test()] |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
155 public void TestPointsPluralAbbreviationFallsBackToSingular () |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
156 { |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
157 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
158 Assert.That(system.GetPointsAbbrev(2), Is.EqualTo("")); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
159 system.SystemPtsAbbrevSingle = "pt"; |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
160 Assert.That(system.GetPointsAbbrev(2), Is.EqualTo("pt")); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
161 } |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
162 |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
163 [Test()] |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
164 public void TestPointsZeroAbbreviationFallsBackToSingular () |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
165 { |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
166 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
167 Assert.That(system.GetPointsAbbrev(0), Is.EqualTo("")); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
168 system.SystemPtsAbbrevSingle = "pt"; |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
169 Assert.That(system.GetPointsAbbrev(0), Is.EqualTo("pt")); |
168c5aab34bb
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
82
diff
changeset
|
170 } |
137
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
171 |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
172 public override GameSystem GetObject () |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
173 { |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
174 DummyWarFoundryFactory factory = new DummyWarFoundryFactory(); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
175 return new GameSystem("system", "system", factory); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
176 } |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
177 |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
178 public override GameSystem GetSameObject () |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
179 { |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
180 DummyWarFoundryFactory factory = new DummyWarFoundryFactory(); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
181 return new GameSystem("system", "system", factory); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
182 } |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
183 |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
184 public override GameSystem GetDifferentObject () |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
185 { |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
186 DummyWarFoundryFactory factory = new DummyWarFoundryFactory(); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
187 return new GameSystem("system2", "another system", factory); |
081b48413f6d
Re #140: Add equality methods to WarFoundry objects
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
188 } |
82
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
189 } |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
190 } |
bbcc46371364
Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
191 |