changeset 110:788ef54f5b5a

Re #27: Define unit requirements * Add last unit test to get more obvious behaviour equivalent to Rollcall's "-1" (can take unlimited X once one Y is taken)
author IBBoard <dev@ibboard.co.uk>
date Tue, 29 Mar 2011 19:51:08 +0000
parents f5f66483032a
children f0b488c9f29b
files API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs	Mon Mar 28 19:40:46 2011 +0000
     1.2 +++ b/API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs	Tue Mar 29 19:51:08 2011 +0000
     1.3 @@ -113,6 +113,16 @@
     1.4  		}
     1.5  
     1.6  		[Test()]
     1.7 +		public void TestAddingUnitTypeRequirementWithNoNumberDefaultsToHavingOne()
     1.8 +		{
     1.9 +			Army army = new Army(mockRace, "Test", 1000);
    1.10 +			AddUnitOfTypeToArmy(unitType2, army);
    1.11 +			RequiresAtLeastNUnitsRequirement req = new RequiresAtLeastNUnitsRequirement();
    1.12 +			req.AddUnitTypeRequirement(unitType2);
    1.13 +			Assert.That(req.AllowsAdding(unitType1, army), Is.True);
    1.14 +		}
    1.15 +
    1.16 +		[Test()]
    1.17  		public void TestValidityOfArmyWithNoUnitsAndOneUnitTypeRequired()
    1.18  		{
    1.19  			Army army = new Army(mockRace, "Test", 1000);