annotate API/Objects/GameSystemTest.cs @ 84:168c5aab34bb

Re #99: Define "points" values in GameSystem * Add tests for fall-back so that just one value can be specified
author IBBoard <dev@ibboard.co.uk>
date Sun, 20 Feb 2011 15:59:33 +0000
parents bbcc46371364
children 081b48413f6d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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;
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 namespace IBBoard.WarFoundry.API.Objects
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 [TestFixture()]
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 public class GameSystemTest
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 {
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 [Test()]
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 public void TestPointsSingularAbbreviation ()
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 {
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 Assert.That(system.GetPointsAbbrev(1), Is.EqualTo(""));
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 system.SystemPtsAbbrevSingle = "pt";
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 system.SystemPtsAbbrevPlural = "pts";
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 Assert.That(system.GetPointsAbbrev(1), Is.EqualTo("pt"));
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 }
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 [Test()]
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 public void TestPointsPluralAbbreviation ()
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 {
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25 Assert.That(system.GetPointsAbbrev(2), Is.EqualTo(""));
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 system.SystemPtsAbbrevSingle = "pt";
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 system.SystemPtsAbbrevPlural = "pts";
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 Assert.That(system.GetPointsAbbrev(2), Is.EqualTo("pts"));
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 }
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 [Test()]
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 public void TestPointsZeroAbbreviation ()
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 {
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 Assert.That(system.GetPointsAbbrev(0), Is.EqualTo(""));
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36 system.SystemPtsAbbrevSingle = "pt";
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37 system.SystemPtsAbbrevPlural = "pts";
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38 Assert.That(system.GetPointsAbbrev(0), Is.EqualTo("pts"));
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
39 }
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
40
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
41 [Test()]
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 public void TestPointsSingularName ()
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43 {
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45 Assert.That(system.GetPointsName(1), Is.EqualTo(""));
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
46 system.SystemPtsNameSingle = "pt";
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47 system.SystemPtsNamePlural = "pts";
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 Assert.That(system.GetPointsName(1), Is.EqualTo("pt"));
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49 }
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
51 [Test()]
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52 public void TestPointsPluralName ()
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
53 {
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
54 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
55 Assert.That(system.GetPointsName(2), Is.EqualTo(""));
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
56 system.SystemPtsNameSingle = "pt";
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
57 system.SystemPtsNamePlural = "pts";
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
58 Assert.That(system.GetPointsName(2), Is.EqualTo("pts"));
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
59 }
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 [Test()]
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
62 public void TestPointsZeroName ()
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
63 {
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
64 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
65 Assert.That(system.GetPointsName(0), Is.EqualTo(""));
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
66 system.SystemPtsNameSingle = "pt";
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
67 system.SystemPtsNamePlural = "pts";
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
68 Assert.That(system.GetPointsName(0), Is.EqualTo("pts"));
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
69 }
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
70
84
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
71 [Test()]
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
72 public void TestPointsSingularNameFallsBackToPlural ()
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
73 {
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
74 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
75 Assert.That(system.GetPointsName(1), Is.EqualTo(""));
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
76 system.SystemPtsNamePlural = "pts";
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
77 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
78 }
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
79
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
80 [Test()]
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
81 public void TestPointsPluralNameFallsBackToSingular ()
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
82 {
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
83 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
84 Assert.That(system.GetPointsName(2), Is.EqualTo(""));
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
85 system.SystemPtsNameSingle = "pt";
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
86 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
87 }
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
88
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
89 [Test()]
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
90 public void TestPointsZeroNameFallsBackToSingular ()
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
91 {
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
92 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
93 Assert.That(system.GetPointsName(0), Is.EqualTo(""));
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
94 system.SystemPtsNameSingle = "pt";
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
95 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
96 }
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
97
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
98 [Test()]
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
99 public void TestPointsSingularAbbreviationFallsBackToPlural ()
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
100 {
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
101 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
102 Assert.That(system.GetPointsAbbrev(1), Is.EqualTo(""));
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
103 system.SystemPtsAbbrevPlural = "pts";
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
104 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
105 }
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
106
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
107 [Test()]
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
108 public void TestPointsPluralAbbreviationFallsBackToSingular ()
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
109 {
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
110 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
111 Assert.That(system.GetPointsAbbrev(2), Is.EqualTo(""));
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
112 system.SystemPtsAbbrevSingle = "pt";
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
113 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
114 }
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
115
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
116 [Test()]
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
117 public void TestPointsZeroAbbreviationFallsBackToSingular ()
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
118 {
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
119 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
120 Assert.That(system.GetPointsAbbrev(0), Is.EqualTo(""));
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
121 system.SystemPtsAbbrevSingle = "pt";
168c5aab34bb Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
122 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
123 }
82
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
124 }
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
125 }
bbcc46371364 Re #99: Define "points" values in GameSystem
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
126