diff API/Objects/Requirement/UnitRequiresAtLeastNUnitsRequirementTest.cs @ 205:d39682a98adf

Re #379: Fix validation of requirements to check for unit * Add unit tests for army object * Update tests that check the message
author IBBoard <dev@ibboard.co.uk>
date Sun, 29 Jan 2012 19:40:19 +0000
parents 8c519a44e699
children 27f163bf884a
line wrap: on
line diff
--- a/API/Objects/Requirement/UnitRequiresAtLeastNUnitsRequirementTest.cs	Sat Jan 28 16:58:42 2012 +0000
+++ b/API/Objects/Requirement/UnitRequiresAtLeastNUnitsRequirementTest.cs	Sun Jan 29 19:40:19 2012 +0000
@@ -277,7 +277,7 @@
 			Army army = new Army(mockRace, "Test", 1000);
 			RequiresAtLeastNUnitsRequirement req = new UnitRequiresAtLeastNUnitsRequirement(unitType1);
 			req.AddUnitTypeRequirement(unitType2, 2);
-			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army contains " + unitType1.Name + " and so must contain: 2 × " + unitType2.Name + " (would have 1)."));
+			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army would contain " + unitType1.Name + " and so must contain: 2 × " + unitType2.Name + " (would have 1)."));
 		}
 
 		[Test]
@@ -287,7 +287,7 @@
 			RequiresAtLeastNUnitsRequirement req = new UnitRequiresAtLeastNUnitsRequirement(unitType1);
 			req.AddUnitTypeRequirement(unitType2);
 			req.AddUnitTypeRequirement(unitType3);
-			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army contains " + unitType1.Name + " and so must contain: 1 × " + unitType3.Name + " (would have 0)."));
+			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army would contain " + unitType1.Name + " and so must contain: 1 × " + unitType3.Name + " (would have 0)."));
 		}
 
 		[Test]
@@ -297,7 +297,7 @@
 			RequiresAtLeastNUnitsRequirement req = new UnitRequiresAtLeastNUnitsRequirement(unitType1);
 			req.AddUnitTypeRequirement(unitType2);
 			req.AddUnitTypeRequirement(unitType3);
-			Assert.That(req.GetAllowsAddingMessage(unitType3, army), Is.EqualTo("Army contains " + unitType1.Name + " and so must contain: 1 × " + unitType2.Name + " (would have 0)."));
+			Assert.That(req.GetAllowsAddingMessage(unitType3, army), Is.EqualTo("Army would contain " + unitType1.Name + " and so must contain: 1 × " + unitType2.Name + " (would have 0)."));
 		}
 
 		[Test]
@@ -308,7 +308,7 @@
 			RequiresAtLeastNUnitsRequirement req = new UnitRequiresAtLeastNUnitsRequirement(unitType1);
 			req.AddUnitTypeRequirement(unitType2);
 			req.AddUnitTypeRequirement(unitType3);
-			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army contains " + unitType1.Name + " and so must contain: 1 × " + unitType3.Name + " (would have 0)."));
+			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army would contain " + unitType1.Name + " and so must contain: 1 × " + unitType3.Name + " (would have 0)."));
 		}
 
 		[Test]
@@ -319,7 +319,7 @@
 			RequiresAtLeastNUnitsRequirement req = new UnitRequiresAtLeastNUnitsRequirement(unitType1);
 			req.AddUnitTypeRequirement(unitType2);
 			req.AddUnitTypeRequirement(unitType3);
-			Assert.That(req.GetAllowsAddingMessage(unitType3, army), Is.EqualTo("Army contains " + unitType1.Name + " and so must contain: 1 × " + unitType2.Name + " (would have 0)."));
+			Assert.That(req.GetAllowsAddingMessage(unitType3, army), Is.EqualTo("Army would contain " + unitType1.Name + " and so must contain: 1 × " + unitType2.Name + " (would have 0)."));
 		}
 
 		private static void AddUnitOfTypeToArmy(UnitType unitType, Army army)