Mercurial > repos > IBDev-IBBoard.WarFoundry.API.Tests
comparison API/Factories/Requirement/UnitRequiresAtLeastNUnitsRequirementFactoryTest.cs @ 154:bf2880cf7bc5
* Fix deprecation warnings
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 02 Jul 2011 19:56:30 +0000 |
parents | e84149f37478 |
children | 3725fd449c77 |
comparison
equal
deleted
inserted
replaced
153:e84149f37478 | 154:bf2880cf7bc5 |
---|---|
105 UnitRequiresAtLeastNUnitsRequirement req = factory.CreateRequirement(unitType, typeID1 + "|" + typeID2 + ":3"); | 105 UnitRequiresAtLeastNUnitsRequirement req = factory.CreateRequirement(unitType, typeID1 + "|" + typeID2 + ":3"); |
106 Assert.That(req, Is.EqualTo(expectedReq)); | 106 Assert.That(req, Is.EqualTo(expectedReq)); |
107 } | 107 } |
108 | 108 |
109 [Test()] | 109 [Test()] |
110 [ExpectedException(typeof(InvalidRequirementException), "Invalid unit type 'fibble' for 'Requires at least N units' requirement")] | 110 [ExpectedException(typeof(InvalidRequirementException), ExpectedMessage="Invalid unit type 'fibble' for 'Requires at least N units' requirement")] |
111 public void TestExceptionsForInvalidID() | 111 public void TestExceptionsForInvalidID() |
112 { | 112 { |
113 UnitRequiresAtLeastNUnitsRequirementFactory factory = new UnitRequiresAtLeastNUnitsRequirementFactory(); | 113 UnitRequiresAtLeastNUnitsRequirementFactory factory = new UnitRequiresAtLeastNUnitsRequirementFactory(); |
114 UnitType unitType = new UnitType("testUnit", "Test Unit", race); | 114 UnitType unitType = new UnitType("testUnit", "Test Unit", race); |
115 factory.CreateRequirement(unitType, "fibble"); | 115 factory.CreateRequirement(unitType, "fibble"); |
116 } | 116 } |
117 | 117 |
118 [Test()] | 118 [Test()] |
119 [ExpectedException(typeof(InvalidRequirementException), "Invalid amount 'a' for unit type 'unit1' for 'Requires at least N units' requirement")] | 119 [ExpectedException(typeof(InvalidRequirementException), ExpectedMessage="Invalid amount 'a' for unit type 'unit1' for 'Requires at least N units' requirement")] |
120 public void TestExceptionsForInvalidNumber() | 120 public void TestExceptionsForInvalidNumber() |
121 { | 121 { |
122 UnitRequiresAtLeastNUnitsRequirementFactory factory = new UnitRequiresAtLeastNUnitsRequirementFactory(); | 122 UnitRequiresAtLeastNUnitsRequirementFactory factory = new UnitRequiresAtLeastNUnitsRequirementFactory(); |
123 UnitType unitType = new UnitType("testUnit", "Test Unit", race); | 123 UnitType unitType = new UnitType("testUnit", "Test Unit", race); |
124 factory.CreateRequirement(unitType, typeID1+":a"); | 124 factory.CreateRequirement(unitType, typeID1+":a"); |