Mercurial > repos > IBBoard.WarFoundry.API.Tests
changeset 13:ca5d7c2c7493
Re #195: Setting max equipment without min may not function correctly
* Add tests for infinity ("equip all") values
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 12 Oct 2009 19:50:48 +0000 |
parents | a4e7e938d065 |
children | 19fc7a733064 |
files | API/Objects/UnitEquipmentItemTest.cs |
diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/API/Objects/UnitEquipmentItemTest.cs Mon Oct 12 19:42:30 2009 +0000 +++ b/API/Objects/UnitEquipmentItemTest.cs Mon Oct 12 19:50:48 2009 +0000 @@ -66,6 +66,24 @@ } [Test()] + public void TestMinNumberLimitUnchangedWhenMaxSetToInfinity() + { + UnitEquipmentItem item = new UnitEquipmentItem(new MockEquipmentItem(), new MockUnitType()); + item.MinNumber = 10; + item.MaxNumber = WarFoundryCore.INFINITY; + Assert.AreEqual(10, item.MinNumber); + } + + [Test()] + public void TestMaxNumberLimitSetToMinWhenMinSetToInfinity() + { + UnitEquipmentItem item = new UnitEquipmentItem(new MockEquipmentItem(), new MockUnitType()); + item.MaxNumber = 10; + item.MinNumber = WarFoundryCore.INFINITY; + Assert.AreEqual(WarFoundryCore.INFINITY, item.MaxNumber); + } + + [Test()] public void DefaultMinMaxPercentageLimitsAreZero() { UnitEquipmentItem item = new UnitEquipmentItem(new MockEquipmentItem(), new MockUnitType());