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 wrap: on
line diff
--- a/API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs	Mon Mar 28 19:40:46 2011 +0000
+++ b/API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs	Tue Mar 29 19:51:08 2011 +0000
@@ -113,6 +113,16 @@
 		}
 
 		[Test()]
+		public void TestAddingUnitTypeRequirementWithNoNumberDefaultsToHavingOne()
+		{
+			Army army = new Army(mockRace, "Test", 1000);
+			AddUnitOfTypeToArmy(unitType2, army);
+			RequiresAtLeastNUnitsRequirement req = new RequiresAtLeastNUnitsRequirement();
+			req.AddUnitTypeRequirement(unitType2);
+			Assert.That(req.AllowsAdding(unitType1, army), Is.True);
+		}
+
+		[Test()]
 		public void TestValidityOfArmyWithNoUnitsAndOneUnitTypeRequired()
 		{
 			Army army = new Army(mockRace, "Test", 1000);