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 diff
     1.1 --- a/API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirementTest.cs	Sun Jan 29 19:40:19 2012 +0000
     1.2 +++ b/API/Objects/Requirement/UnitRequiresNoMoreThanNOfUnitTypeRequirementTest.cs	Sun Jan 29 20:03:44 2012 +0000
     1.3 @@ -190,7 +190,7 @@
     1.4  		}
     1.5  
     1.6  		[Test]
     1.7 -		public void TestValidationMessageIsCorrectForFailWithTwoUnitsProhibitedAndOtherUnitInArmy()
     1.8 +		public void TestValidationMessageIsCorrectForFailWithTwoUnitsProhibitedAndOtherUnitInArmy()
     1.9  		{
    1.10  			Army army = new Army(mockRace, "Test", 1000);
    1.11  			AddUnitOfTypeToArmy(unitType1, army);
    1.12 @@ -202,7 +202,7 @@
    1.13  		}
    1.14  
    1.15  		[Test]
    1.16 -		public void TestValidationMessageIsCorrectForFailWithTwoUnitsProhibitedAndBothUnitsInArmy()
    1.17 +		public void TestValidationMessageIsCorrectForFailWithTwoUnitsProhibitedAndBothUnitsInArmy()
    1.18  		{
    1.19  			Army army = new Army(mockRace, "Test", 1000);
    1.20  			AddUnitOfTypeToArmy(unitType1, army);
    1.21 @@ -230,7 +230,7 @@
    1.22  			AddUnitOfTypeToArmy(unitType1, army);
    1.23  			RequiresNoMoreThanNOfUnitTypeRequirement req = new UnitRequiresNoMoreThanNOfUnitTypeRequirement(unitType1);
    1.24  			req.AddUnitTypeRequirement(unitType2);
    1.25 -			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army contains " + unitType1.Name + " and so cannot contain more than: 0 × " + unitType2.Name + " (would have 1)."));
    1.26 +			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)."));
    1.27  		}
    1.28  
    1.29  		[Test]
    1.30 @@ -242,7 +242,7 @@
    1.31  			AddUnitOfTypeToArmy(unitType2, army);
    1.32  			RequiresNoMoreThanNOfUnitTypeRequirement req = new UnitRequiresNoMoreThanNOfUnitTypeRequirement(unitType1);
    1.33  			req.AddUnitTypeRequirement(unitType2, 2);
    1.34 -			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army contains " + unitType1.Name + " and so cannot contain more than: 2 × " + unitType2.Name + " (would have 3)."));
    1.35 +			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)."));
    1.36  		}
    1.37  
    1.38  		[Test]
    1.39 @@ -253,7 +253,7 @@
    1.40  			RequiresNoMoreThanNOfUnitTypeRequirement req = new UnitRequiresNoMoreThanNOfUnitTypeRequirement(unitType1);
    1.41  			req.AddUnitTypeRequirement(unitType2);
    1.42  			req.AddUnitTypeRequirement(unitType3);
    1.43 -			Assert.That(req.GetAllowsAddingMessage(unitType2, army), Is.EqualTo("Army contains " + unitType1.Name + " and so cannot contain more than: 0 × " + unitType2.Name + " (would have 1)."));
    1.44 +			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)."));
    1.45  		}
    1.46  
    1.47  		[Test]
    1.48 @@ -265,7 +265,7 @@
    1.49  			RequiresNoMoreThanNOfUnitTypeRequirement req = new UnitRequiresNoMoreThanNOfUnitTypeRequirement(unitType1);
    1.50  			req.AddUnitTypeRequirement(unitType2);
    1.51  			req.AddUnitTypeRequirement(unitType3);
    1.52 -			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)."));
    1.53 +			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)."));
    1.54  		}
    1.55  
    1.56  		[Test]
    1.57 @@ -277,7 +277,7 @@
    1.58  			RequiresNoMoreThanNOfUnitTypeRequirement req = new UnitRequiresNoMoreThanNOfUnitTypeRequirement(unitType1);
    1.59  			req.AddUnitTypeRequirement(unitType2);
    1.60  			req.AddUnitTypeRequirement(unitType3);
    1.61 -			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)."));
    1.62 +			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)."));
    1.63  		}
    1.64  
    1.65  		private static void AddUnitOfTypeToArmy(UnitType unitType, Army army)