# HG changeset patch # User IBBoard # Date 1322928818 0 # Node ID 2b19d6f18f3a69a056675f24a1a76ca90a392e57 # Parent 702a0957f9e43c280a3e1622e357a2ed447c29b7 Re #350: Add requirement to allow N of unit for specific other units * Correct expected output in tests - we haven't added when we check if adding is okay diff -r 702a0957f9e4 -r 2b19d6f18f3a API/Objects/Requirement/RequiresNUnitsForMUnitsRequirementTest.cs --- a/API/Objects/Requirement/RequiresNUnitsForMUnitsRequirementTest.cs Wed Nov 30 21:05:54 2011 +0000 +++ b/API/Objects/Requirement/RequiresNUnitsForMUnitsRequirementTest.cs Sat Dec 03 16:13:38 2011 +0000 @@ -59,7 +59,7 @@ RequiresNUnitsForMUnitsRequirement req = new RequiresNUnitsForMUnitsRequirement(unitType1, unitType2); Unit unit = CreateUnitOfType(unitType1, army); Assert.That(req.AllowsAdding(unit, army), Is.EqualTo(Validation.Failed)); - Assert.That(req.GetAllowsAddingMessage(unit.UnitType, army), Is.EqualTo("Army must contain: 1 "+unitType2.Name+" for every 1 "+unitType1.Name + " (have 0 for 1).")); + Assert.That(req.GetAllowsAddingMessage(unit.UnitType, army), Is.EqualTo("Army must contain: 1 "+unitType2.Name+" for every 1 "+unitType1.Name + " (would have 0 for 1).")); } [Test()] @@ -71,7 +71,7 @@ RequiresNUnitsForMUnitsRequirement req = new RequiresNUnitsForMUnitsRequirement(unitType1, unitType2); Unit unit = CreateUnitOfType(unitType1, army); Assert.That(req.AllowsAdding(unit, army), Is.EqualTo(Validation.Failed)); - Assert.That(req.GetAllowsAddingMessage(unit.UnitType, army), Is.EqualTo("Army must contain: 1 " + unitType2.Name + " for every 1 " + unitType1.Name + " (have 1 for 2).")); + Assert.That(req.GetAllowsAddingMessage(unit.UnitType, army), Is.EqualTo("Army must contain: 1 " + unitType2.Name + " for every 1 " + unitType1.Name + " (would have 1 for 2).")); } [Test()] @@ -98,7 +98,7 @@ req.AddUnitTypeRequirement(unitType2, 1, 2); Unit unit = CreateUnitOfType(unitType1, army); Assert.That(req.AllowsAdding(unit, army), Is.EqualTo(Validation.Failed)); - Assert.That(req.GetAllowsAddingMessage(unit.UnitType, army), Is.EqualTo("Army must contain: 1 " + unitType2.Name + " for every 2 " + unitType1.Name + " (have 1 for 3).")); + Assert.That(req.GetAllowsAddingMessage(unit.UnitType, army), Is.EqualTo("Army must contain: 1 " + unitType2.Name + " for every 2 " + unitType1.Name + " (would have 1 for 3).")); } [Test()]