changeset 128:7ca536ccd27a

Re #27: * Start testing adding requirements to unit types
author IBBoard <dev@ibboard.co.uk>
date Sat, 09 Apr 2011 15:59:55 +0000
parents 779ad76c2644
children 95dac00e9330
files API/Objects/UnitTypeTest.cs
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/API/Objects/UnitTypeTest.cs	Sat Apr 09 15:49:09 2011 +0000
+++ b/API/Objects/UnitTypeTest.cs	Sat Apr 09 15:59:55 2011 +0000
@@ -5,6 +5,7 @@
 using NUnit.Framework;
 using NUnit.Framework.Constraints;
 using NUnit.Framework.SyntaxHelpers;
+using IBBoard.WarFoundry.API.Objects.Requirement;
 
 namespace IBBoard.WarFoundry.API.Objects
 {
@@ -44,6 +45,16 @@
 			Assert.That(unitType.Categories, Has.Member(mockCategory2));
 			Assert.That(unitType.MainCategory, Is.EqualTo(mockCategory));
 		}
+
+		[Test]
+		public void TestAddingRequirementsToUnitType()
+		{
+			UnitType unitType = new UnitType("unittype1", "Swordsmen", new MockRace());
+			UnitRequiresAtLeastNUnitsRequirement req = new UnitRequiresAtLeastNUnitsRequirement(unitType);
+			Assert.That(unitType.GetRequirements(), Has.Length(0));
+			unitType.AddRequirement(req);
+			Assert.That(unitType.GetRequirements(), Has.Length(1));
+		}
 	}
 }