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 diff
     1.1 --- a/API/Objects/UnitTypeTest.cs	Sat Apr 09 15:49:09 2011 +0000
     1.2 +++ b/API/Objects/UnitTypeTest.cs	Sat Apr 09 15:59:55 2011 +0000
     1.3 @@ -5,6 +5,7 @@
     1.4  using NUnit.Framework;
     1.5  using NUnit.Framework.Constraints;
     1.6  using NUnit.Framework.SyntaxHelpers;
     1.7 +using IBBoard.WarFoundry.API.Objects.Requirement;
     1.8  
     1.9  namespace IBBoard.WarFoundry.API.Objects
    1.10  {
    1.11 @@ -44,6 +45,16 @@
    1.12  			Assert.That(unitType.Categories, Has.Member(mockCategory2));
    1.13  			Assert.That(unitType.MainCategory, Is.EqualTo(mockCategory));
    1.14  		}
    1.15 +
    1.16 +		[Test]
    1.17 +		public void TestAddingRequirementsToUnitType()
    1.18 +		{
    1.19 +			UnitType unitType = new UnitType("unittype1", "Swordsmen", new MockRace());
    1.20 +			UnitRequiresAtLeastNUnitsRequirement req = new UnitRequiresAtLeastNUnitsRequirement(unitType);
    1.21 +			Assert.That(unitType.GetRequirements(), Has.Length(0));
    1.22 +			unitType.AddRequirement(req);
    1.23 +			Assert.That(unitType.GetRequirements(), Has.Length(1));
    1.24 +		}
    1.25  	}
    1.26  }
    1.27