Mercurial > repos > IBBoard.WarFoundry.API.Tests
comparison API/Objects/GameSystemTest.cs @ 82:bbcc46371364
Re #99: Define "points" values in GameSystem
* Add unit tests
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 13 Feb 2011 21:02:47 +0000 |
parents | |
children | 168c5aab34bb |
comparison
equal
deleted
inserted
replaced
81:eb62004d8a35 | 82:bbcc46371364 |
---|---|
1 using System; | |
2 using NUnit.Framework; | |
3 using IBBoard.WarFoundry.API.Factories; | |
4 using NUnit.Framework.SyntaxHelpers; | |
5 | |
6 namespace IBBoard.WarFoundry.API.Objects | |
7 { | |
8 [TestFixture()] | |
9 public class GameSystemTest | |
10 { | |
11 [Test()] | |
12 public void TestPointsSingularAbbreviation () | |
13 { | |
14 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); | |
15 Assert.That(system.GetPointsAbbrev(1), Is.EqualTo("")); | |
16 system.SystemPtsAbbrevSingle = "pt"; | |
17 system.SystemPtsAbbrevPlural = "pts"; | |
18 Assert.That(system.GetPointsAbbrev(1), Is.EqualTo("pt")); | |
19 } | |
20 | |
21 [Test()] | |
22 public void TestPointsPluralAbbreviation () | |
23 { | |
24 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); | |
25 Assert.That(system.GetPointsAbbrev(2), Is.EqualTo("")); | |
26 system.SystemPtsAbbrevSingle = "pt"; | |
27 system.SystemPtsAbbrevPlural = "pts"; | |
28 Assert.That(system.GetPointsAbbrev(2), Is.EqualTo("pts")); | |
29 } | |
30 | |
31 [Test()] | |
32 public void TestPointsZeroAbbreviation () | |
33 { | |
34 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); | |
35 Assert.That(system.GetPointsAbbrev(0), Is.EqualTo("")); | |
36 system.SystemPtsAbbrevSingle = "pt"; | |
37 system.SystemPtsAbbrevPlural = "pts"; | |
38 Assert.That(system.GetPointsAbbrev(0), Is.EqualTo("pts")); | |
39 } | |
40 | |
41 [Test()] | |
42 public void TestPointsSingularName () | |
43 { | |
44 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); | |
45 Assert.That(system.GetPointsName(1), Is.EqualTo("")); | |
46 system.SystemPtsNameSingle = "pt"; | |
47 system.SystemPtsNamePlural = "pts"; | |
48 Assert.That(system.GetPointsName(1), Is.EqualTo("pt")); | |
49 } | |
50 | |
51 [Test()] | |
52 public void TestPointsPluralName () | |
53 { | |
54 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); | |
55 Assert.That(system.GetPointsName(2), Is.EqualTo("")); | |
56 system.SystemPtsNameSingle = "pt"; | |
57 system.SystemPtsNamePlural = "pts"; | |
58 Assert.That(system.GetPointsName(2), Is.EqualTo("pts")); | |
59 } | |
60 | |
61 [Test()] | |
62 public void TestPointsZeroName () | |
63 { | |
64 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); | |
65 Assert.That(system.GetPointsName(0), Is.EqualTo("")); | |
66 system.SystemPtsNameSingle = "pt"; | |
67 system.SystemPtsNamePlural = "pts"; | |
68 Assert.That(system.GetPointsName(0), Is.EqualTo("pts")); | |
69 } | |
70 | |
71 } | |
72 } | |
73 |