changeset 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 e49f7cdff479
children 052148dc0a2f
files API/Objects/GameSystemTest.cs
diffstat 1 files changed, 53 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/API/Objects/GameSystemTest.cs	Sat Feb 19 20:47:27 2011 +0000
+++ b/API/Objects/GameSystemTest.cs	Sun Feb 20 15:59:33 2011 +0000
@@ -68,6 +68,59 @@
 			Assert.That(system.GetPointsName(0), Is.EqualTo("pts"));
 		}
 		
+		[Test()]
+		public void TestPointsSingularNameFallsBackToPlural ()
+		{
+			GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
+			Assert.That(system.GetPointsName(1), Is.EqualTo(""));
+			system.SystemPtsNamePlural = "pts";
+			Assert.That(system.GetPointsName(1), Is.EqualTo("pts"));
+		}
+		
+		[Test()]
+		public void TestPointsPluralNameFallsBackToSingular ()
+		{
+			GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
+			Assert.That(system.GetPointsName(2), Is.EqualTo(""));
+			system.SystemPtsNameSingle = "pt";
+			Assert.That(system.GetPointsName(2), Is.EqualTo("pt"));
+		}
+		
+		[Test()]
+		public void TestPointsZeroNameFallsBackToSingular ()
+		{
+			GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
+			Assert.That(system.GetPointsName(0), Is.EqualTo(""));
+			system.SystemPtsNameSingle = "pt";
+			Assert.That(system.GetPointsName(0), Is.EqualTo("pt"));
+		}
+		
+		[Test()]
+		public void TestPointsSingularAbbreviationFallsBackToPlural ()
+		{
+			GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
+			Assert.That(system.GetPointsAbbrev(1), Is.EqualTo(""));
+			system.SystemPtsAbbrevPlural = "pts";
+			Assert.That(system.GetPointsAbbrev(1), Is.EqualTo("pts"));
+		}
+		
+		[Test()]
+		public void TestPointsPluralAbbreviationFallsBackToSingular ()
+		{
+			GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
+			Assert.That(system.GetPointsAbbrev(2), Is.EqualTo(""));
+			system.SystemPtsAbbrevSingle = "pt";
+			Assert.That(system.GetPointsAbbrev(2), Is.EqualTo("pt"));
+		}
+		
+		[Test()]
+		public void TestPointsZeroAbbreviationFallsBackToSingular ()
+		{
+			GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
+			Assert.That(system.GetPointsAbbrev(0), Is.EqualTo(""));
+			system.SystemPtsAbbrevSingle = "pt";
+			Assert.That(system.GetPointsAbbrev(0), Is.EqualTo("pt"));
+		}
 	}
 }