Mercurial > repos > IBBoard.WarFoundry.API.Tests
diff API/Objects/Requirement/UnitRequiresNUnitsForMUnitsRequirementTests.cs @ 214:1674a499168e
Re #379:
* Make all tests test both Unit and UnitType by modifying abstract class's helper methods
* Re-implement UnitRequiresAtLeastNUnitsRequirementTest tests (adding and validation)
* Remove unused tests from Requires...
TODO: Re-implement equality testing
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 26 Feb 2012 20:18:45 +0000 |
parents | 325943cb1db0 |
children | 9bf34e88da89 |
line wrap: on
line diff
--- a/API/Objects/Requirement/UnitRequiresNUnitsForMUnitsRequirementTests.cs Sun Feb 26 15:38:13 2012 +0000 +++ b/API/Objects/Requirement/UnitRequiresNUnitsForMUnitsRequirementTests.cs Sun Feb 26 20:18:45 2012 +0000 @@ -29,16 +29,6 @@ } [Test()] - public void TestAddingUnitWithNoUnitsAndOneUnitTypeRequiredFails() - { - Army army = new Army(mockRace, "Test", 1000); - Unit unit = CreateUnitOfType(unitType1, army); - UnitRequiresNUnitsForMUnitsRequirement req = new UnitRequiresNUnitsForMUnitsRequirement(unitType1); - req.AddUnitTypeRequirement(unitType2); - Assert_That__FailsAdding(req, unit, army, "Army must contain: 1 × " + unitType2.Name + " for every 1 × " + unitType1.Name + " (would have 0 for 1)."); - } - - [Test()] public void TestAddingUnitTypeWithNoUnitsAndOneUnitTypeRequiredFails() { Army army = new Army(mockRace, "Test", 1000); @@ -48,17 +38,6 @@ } [Test()] - public void TestAddingUnitWithOneUnitAndOneUnitTypeRequiredPasses() - { - Army army = new Army(mockRace, "Test", 1000); - AddUnitOfTypeToArmy(unitType2, army); - Unit unit = CreateUnitOfType(unitType1, army); - UnitRequiresNUnitsForMUnitsRequirement req = new UnitRequiresNUnitsForMUnitsRequirement(unitType1); - req.AddUnitTypeRequirement(unitType2); - Assert_That__PassesAdding(req, unit, army); - } - - [Test()] public void TestAddingUnitTypeWithOneUnitAndOneUnitTypeRequiredPasses() { Army army = new Army(mockRace, "Test", 1000); @@ -69,17 +48,6 @@ } [Test()] - public void TestAddingUnitWithOneUnitAndOneUnitTypeRequiredPassesWhenAddingRequiredUnit() - { - Army army = new Army(mockRace, "Test", 1000); - AddUnitOfTypeToArmy(unitType1, army); - Unit unit = CreateUnitOfType(unitType2, army); - UnitRequiresNUnitsForMUnitsRequirement req = new UnitRequiresNUnitsForMUnitsRequirement(unitType1); - req.AddUnitTypeRequirement(unitType2); - Assert_That__PassesAdding(req, unit, army); - } - - [Test()] public void TestAddingUnitTypeWithOneUnitAndOneUnitTypeRequiredPassesWhenAddingRequiredUnitType() { Army army = new Army(mockRace, "Test", 1000); @@ -151,9 +119,7 @@ UnitRequiresNUnitsForMUnitsRequirement req = new UnitRequiresNUnitsForMUnitsRequirement(unitType1); req.AddUnitTypeRequirement(unitType2); Assert_That__AddingNotApplicable(req, unitType3, army); - Assert_That__AddingNotApplicable(req, CreateUnitOfType(unitType3, army), army); Assert_That__AddingNotApplicable(req, unitType2, army); - Assert_That__AddingNotApplicable(req, CreateUnitOfType(unitType2, army), army); } [Test]