Mercurial > repos > IBDev-IBBoard.WarFoundry.API.Tests
comparison API/Objects/UnitEquipmentItemTest.cs @ 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 | 9b23e72ba3cf |
comparison
equal
deleted
inserted
replaced
12:a4e7e938d065 | 13:ca5d7c2c7493 |
---|---|
64 item.MinNumber = 10; | 64 item.MinNumber = 10; |
65 item.MaxNumber = 10; | 65 item.MaxNumber = 10; |
66 } | 66 } |
67 | 67 |
68 [Test()] | 68 [Test()] |
69 public void TestMinNumberLimitUnchangedWhenMaxSetToInfinity() | |
70 { | |
71 UnitEquipmentItem item = new UnitEquipmentItem(new MockEquipmentItem(), new MockUnitType()); | |
72 item.MinNumber = 10; | |
73 item.MaxNumber = WarFoundryCore.INFINITY; | |
74 Assert.AreEqual(10, item.MinNumber); | |
75 } | |
76 | |
77 [Test()] | |
78 public void TestMaxNumberLimitSetToMinWhenMinSetToInfinity() | |
79 { | |
80 UnitEquipmentItem item = new UnitEquipmentItem(new MockEquipmentItem(), new MockUnitType()); | |
81 item.MaxNumber = 10; | |
82 item.MinNumber = WarFoundryCore.INFINITY; | |
83 Assert.AreEqual(WarFoundryCore.INFINITY, item.MaxNumber); | |
84 } | |
85 | |
86 [Test()] | |
69 public void DefaultMinMaxPercentageLimitsAreZero() | 87 public void DefaultMinMaxPercentageLimitsAreZero() |
70 { | 88 { |
71 UnitEquipmentItem item = new UnitEquipmentItem(new MockEquipmentItem(), new MockUnitType()); | 89 UnitEquipmentItem item = new UnitEquipmentItem(new MockEquipmentItem(), new MockUnitType()); |
72 Assert.AreEqual(0, item.MinPercentage); | 90 Assert.AreEqual(0, item.MinPercentage); |
73 Assert.AreEqual(0, item.MaxPercentage); | 91 Assert.AreEqual(0, item.MaxPercentage); |