changeset 206:78ba834cb1f7

Re #379: Fix validation of requirements to check for unit * Fix expected text for "Requires no more than", which has a slightly different format
author IBBoard <dev@ibboard.co.uk>
date Sun, 29 Jan 2012 20:03:44 +0000
parents d39682a98adf
children 27f163bf884a
files API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirementTest.cs
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirementTest.cs	Sun Jan 29 19:40:19 2012 +0000
+++ b/API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirementTest.cs	Sun Jan 29 20:03:44 2012 +0000
@@ -190,7 +190,7 @@
 		}
 
 		[Test]
-		public void TestValidationMessageIsCorrectForFailWithTwoUnitsProhibitedAndOtherUnitInArmy()
+		public void TestValidationMessageIsCorrectForFailWithTwoUnitsProhibitedAndOtherUnitInArmy()
 		{
 			Army army = new Army(mockRace, "Test", 1000);
 			AddUnitOfTypeToArmy(unitType1, army);
@@ -202,7 +202,7 @@
 		}
 
 		[Test]
-		public void TestValidationMessageIsCorrectForFailWithTwoUnitsProhibitedAndBothUnitsInArmy()
+		public void TestValidationMessageIsCorrectForFailWithTwoUnitsProhibitedAndBothUnitsInArmy()
 		{
 			Army army = new Army(mockRace, "Test", 1000);
 			AddUnitOfTypeToArmy(unitType1, army);
@@ -230,7 +230,7 @@
 			AddUnitOfTypeToArmy(unitType1, army);
 			RequiresNoMoreThanNOfUnitTypeRequirement req = new UnitRequiresNoMoreThanNOfUnitTypeRequirement(unitType1);
 			req.AddUnitTypeRequirement(unitType2);
-			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army contains " + unitType1.Name + " and so cannot contain more than: 0 × " + unitType2.Name + " (would have 1)."));
+			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army would contain " + unitType1.Name + " and so cannot contain more than: 0 × " + unitType2.Name + " (would have 1)."));
 		}
 
 		[Test]
@@ -242,7 +242,7 @@
 			AddUnitOfTypeToArmy(unitType2, army);
 			RequiresNoMoreThanNOfUnitTypeRequirement req = new UnitRequiresNoMoreThanNOfUnitTypeRequirement(unitType1);
 			req.AddUnitTypeRequirement(unitType2, 2);
-			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army contains " + unitType1.Name + " and so cannot contain more than: 2 × " + unitType2.Name + " (would have 3)."));
+			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army would contain " + unitType1.Name + " and so cannot contain more than: 2 × " + unitType2.Name + " (would have 3)."));
 		}
 
 		[Test]
@@ -253,7 +253,7 @@
 			RequiresNoMoreThanNOfUnitTypeRequirement req = new UnitRequiresNoMoreThanNOfUnitTypeRequirement(unitType1);
 			req.AddUnitTypeRequirement(unitType2);
 			req.AddUnitTypeRequirement(unitType3);
-			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army contains " + unitType1.Name + " and so cannot contain more than: 0 × " + unitType2.Name + " (would have 1)."));
+			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army would contain " + unitType1.Name + " and so cannot contain more than: 0 × " + unitType2.Name + " (would have 1)."));
 		}
 
 		[Test]
@@ -265,7 +265,7 @@
 			RequiresNoMoreThanNOfUnitTypeRequirement req = new UnitRequiresNoMoreThanNOfUnitTypeRequirement(unitType1);
 			req.AddUnitTypeRequirement(unitType2);
 			req.AddUnitTypeRequirement(unitType3);
-			Assert.That(req.GetAllowsAddingMessage(unitType3, army), Is.EqualTo("Army contains " + unitType1.Name + " and so cannot contain more than: 0 × " + unitType2.Name + " (would have 1); 0 × " + unitType3.Name + " (would have 1)."));
+			Assert.That(req.GetAllowsAddingMessage(unitType3, army), Is.EqualTo("Army would contain " + unitType1.Name + " and so cannot contain more than: 0 × " + unitType2.Name + " (would have 1); 0 × " + unitType3.Name + " (would have 1)."));
 		}
 
 		[Test]
@@ -277,7 +277,7 @@
 			RequiresNoMoreThanNOfUnitTypeRequirement req = new UnitRequiresNoMoreThanNOfUnitTypeRequirement(unitType1);
 			req.AddUnitTypeRequirement(unitType2);
 			req.AddUnitTypeRequirement(unitType3);
-			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army contains " + unitType1.Name + " and so cannot contain more than: 0 × " + unitType2.Name + " (would have 1); 0 × " + unitType3.Name + " (would have 1)."));
+			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army would contain " + unitType1.Name + " and so cannot contain more than: 0 × " + unitType2.Name + " (would have 1); 0 × " + unitType3.Name + " (would have 1)."));
 		}
 
 		private static void AddUnitOfTypeToArmy(UnitType unitType, Army army)