Mercurial > repos > IBDev-IBBoard.WarFoundry.API.Tests
annotate API/Objects/Mock/MockPercentageAmountUnitEquipmentItem.cs @ 26:e6bf9b5e1b94
Re #198: Add equipment slots
* Alter constructors of mock percentage unit equipment items for more flexibility
* Consolidate tests
* Add full set of tests for getting max percentage
* Add extra tests to handle different limits
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 28 Oct 2009 20:43:33 +0000 |
parents | d48e73488838 |
children |
rev | line source |
---|---|
15
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 // This file (MockUnitEquipmentItem.cs) is a part of the IBBoard.WarFoundry.API.Tests project and is copyright 2009 IBBoard |
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 // |
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. |
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 |
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 using System; |
19 | 6 using IBBoard.Limits; |
16
74346d5c17fe
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
15
diff
changeset
|
7 using IBBoard.WarFoundry.API.Objects; |
15
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 |
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 namespace IBBoard.WarFoundry.API.Objects.Mock |
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 { |
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 public class MockPercentageAmountUnitEquipmentItem : UnitEquipmentItem |
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 { |
16
74346d5c17fe
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
15
diff
changeset
|
13 public MockPercentageAmountUnitEquipmentItem () : this(new MockEquipmentItem(), new MockUnitType()) |
74346d5c17fe
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
15
diff
changeset
|
14 { |
74346d5c17fe
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
15
diff
changeset
|
15 } |
74346d5c17fe
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
15
diff
changeset
|
16 |
26 | 17 public MockPercentageAmountUnitEquipmentItem(double percentage) : this(percentage, percentage) |
18 { | |
19 } | |
20 | |
21 public MockPercentageAmountUnitEquipmentItem(double min, double max) : this(new MockEquipmentItem(), new MockUnitType(), min, max) | |
25 | 22 { |
23 } | |
24 | |
26 | 25 public MockPercentageAmountUnitEquipmentItem(EquipmentItem item, UnitType type) : this(item, type, 50, 50) |
15
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 { |
25 | 27 } |
28 | |
26 | 29 public MockPercentageAmountUnitEquipmentItem(EquipmentItem item, UnitType type, double min, double max) : base(item, type) |
25 | 30 { |
26 | 31 MinLimit = new SimpleRoundedPercentageLimit(min, false); |
32 MaxLimit = new SimpleRoundedPercentageLimit(max, false); | |
15
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
33 } |
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
34 } |
1119b6f48e8e
Re #198: Add slots with counts to units
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
35 } |