changeset 108:74bfe8b325d6

Re #27: Define unit requirements * Add tests where a min count > 1 is set
author IBBoard <dev@ibboard.co.uk>
date Sun, 27 Mar 2011 19:49:51 +0000
parents e2ea6562ef08
children f5f66483032a
files API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs	Sun Mar 27 19:36:31 2011 +0000
     1.2 +++ b/API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs	Sun Mar 27 19:49:51 2011 +0000
     1.3 @@ -92,7 +92,7 @@
     1.4  		}
     1.5  
     1.6  		[Test()]
     1.7 -		public void TestAddingUnitTypeWithOneUnitsAndTwoOfOneUnitTypeRequired()
     1.8 +		public void TestAddingUnitTypeWithOneUnitAndTwoOfOneUnitTypeRequired()
     1.9  		{
    1.10  			Army army = new Army(mockRace, "Test", 1000);
    1.11  			AddUnitOfTypeToArmy(unitType2, army);
    1.12 @@ -102,11 +102,13 @@
    1.13  		}
    1.14  
    1.15  		[Test()]
    1.16 -		public void TestAddingUnitTypeWithOneUnitAndOneUnitTypeRequired()
    1.17 +		public void TestAddingUnitTypeWithTwoUnitAndTwoOfOneUnitTypeRequired()
    1.18  		{
    1.19  			Army army = new Army(mockRace, "Test", 1000);
    1.20  			AddUnitOfTypeToArmy(unitType2, army);
    1.21 -			RequiresAtLeastNUnitsRequirement req = new RequiresAtLeastNUnitsRequirement(unitType2);
    1.22 +			AddUnitOfTypeToArmy(unitType2, army);
    1.23 +			RequiresAtLeastNUnitsRequirement req = new RequiresAtLeastNUnitsRequirement();
    1.24 +			req.AddUnitTypeRequirement(unitType2, 2);
    1.25  			Assert.That(req.AllowsAdding(unitType1, army), Is.True);
    1.26  		}
    1.27