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 diff
     1.1 --- a/API/Objects/GameSystemTest.cs	Sat Feb 19 20:47:27 2011 +0000
     1.2 +++ b/API/Objects/GameSystemTest.cs	Sun Feb 20 15:59:33 2011 +0000
     1.3 @@ -68,6 +68,59 @@
     1.4  			Assert.That(system.GetPointsName(0), Is.EqualTo("pts"));
     1.5  		}
     1.6  		
     1.7 +		[Test()]
     1.8 +		public void TestPointsSingularNameFallsBackToPlural ()
     1.9 +		{
    1.10 +			GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
    1.11 +			Assert.That(system.GetPointsName(1), Is.EqualTo(""));
    1.12 +			system.SystemPtsNamePlural = "pts";
    1.13 +			Assert.That(system.GetPointsName(1), Is.EqualTo("pts"));
    1.14 +		}
    1.15 +		
    1.16 +		[Test()]
    1.17 +		public void TestPointsPluralNameFallsBackToSingular ()
    1.18 +		{
    1.19 +			GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
    1.20 +			Assert.That(system.GetPointsName(2), Is.EqualTo(""));
    1.21 +			system.SystemPtsNameSingle = "pt";
    1.22 +			Assert.That(system.GetPointsName(2), Is.EqualTo("pt"));
    1.23 +		}
    1.24 +		
    1.25 +		[Test()]
    1.26 +		public void TestPointsZeroNameFallsBackToSingular ()
    1.27 +		{
    1.28 +			GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
    1.29 +			Assert.That(system.GetPointsName(0), Is.EqualTo(""));
    1.30 +			system.SystemPtsNameSingle = "pt";
    1.31 +			Assert.That(system.GetPointsName(0), Is.EqualTo("pt"));
    1.32 +		}
    1.33 +		
    1.34 +		[Test()]
    1.35 +		public void TestPointsSingularAbbreviationFallsBackToPlural ()
    1.36 +		{
    1.37 +			GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
    1.38 +			Assert.That(system.GetPointsAbbrev(1), Is.EqualTo(""));
    1.39 +			system.SystemPtsAbbrevPlural = "pts";
    1.40 +			Assert.That(system.GetPointsAbbrev(1), Is.EqualTo("pts"));
    1.41 +		}
    1.42 +		
    1.43 +		[Test()]
    1.44 +		public void TestPointsPluralAbbreviationFallsBackToSingular ()
    1.45 +		{
    1.46 +			GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
    1.47 +			Assert.That(system.GetPointsAbbrev(2), Is.EqualTo(""));
    1.48 +			system.SystemPtsAbbrevSingle = "pt";
    1.49 +			Assert.That(system.GetPointsAbbrev(2), Is.EqualTo("pt"));
    1.50 +		}
    1.51 +		
    1.52 +		[Test()]
    1.53 +		public void TestPointsZeroAbbreviationFallsBackToSingular ()
    1.54 +		{
    1.55 +			GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
    1.56 +			Assert.That(system.GetPointsAbbrev(0), Is.EqualTo(""));
    1.57 +			system.SystemPtsAbbrevSingle = "pt";
    1.58 +			Assert.That(system.GetPointsAbbrev(0), Is.EqualTo("pt"));
    1.59 +		}
    1.60  	}
    1.61  }
    1.62