annotate API/Util/UnitEquipmentUtilTest.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 0676f6a1ee9d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 // This file (UnitEquipmentItemUtilTest.cs) is a part of the IBBoard.WarFoundry.API.Tests project and is copyright 2009 IBBoard
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 //
e8e7554fb7f3 Re #198: Add slots with count
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.
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 using System;
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 using NUnit.Framework;
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 using IBBoard.Limits;
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 using IBBoard.WarFoundry.API.Objects;
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 using IBBoard.WarFoundry.API.Objects.Mock;
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 namespace IBBoard.WarFoundry.API.Util
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 {
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 [TestFixture()]
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 public class UnitEquipmentUtilTest
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 {
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
16 private const string SLOT_NAME = "slot";
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
17
18
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 [Test()]
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
19 public void TestGetEquipmentCountsForFixedLimitItemOnDefaultSlot()
18
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 {
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
21 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem(4);
18
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 UnitType unitType = equip.EquipmentForUnit;
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
23 Unit unit = GetUnit (unitType);
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
24 Assert.AreEqual(4, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
25 Assert.AreEqual(4, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
26 Assert.AreEqual(4.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
18
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 }
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 [Test()]
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
30 public void TestGetEquipmentCountsForFixedLimitItemOnDefaultSlotWithDifferentMinLimit()
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
31 {
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
32 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem(1,4);
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
33 UnitType unitType = equip.EquipmentForUnit;
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
34 Unit unit = GetUnit (unitType);
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
35 Assert.AreEqual(4, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
36 Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
37 Assert.AreEqual(4.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
38 }
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
39
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
40 [Test()]
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
41 public void TestGetEquipmentCountsForFixedLimitItemOnNumberLimitedSlot()
18
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 {
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
43 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem(3);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
44 equip.SlotName = SLOT_NAME;
18
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45 UnitType unitType = equip.EquipmentForUnit;
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
46 unitType.AddEquipmentSlot(SLOT_NAME, new AbsoluteNumericLimit(2));
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
47 Unit unit = GetUnit(unitType);
18
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 Assert.AreEqual(2, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
49 Assert.AreEqual(2, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
50 Assert.AreEqual(2.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
51 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
52
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
53 [Test()]
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
54 public void TestGetEquipmentCountsForFixedLimitItemOnNumberLimitedSlotWithDifferentMinLimit()
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
55 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
56 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem(1, 3);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
57 equip.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
58 UnitType unitType = equip.EquipmentForUnit;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
59 unitType.AddEquipmentSlot(SLOT_NAME, new AbsoluteNumericLimit(2));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
60 Unit unit = GetUnit(unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
61 Assert.AreEqual(2, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
62 Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
63 Assert.AreEqual(2.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
64 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
65
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
66 [Test()]
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
67 public void TestGetEquipmentCountsForFixedLimitItemOnNumberLimitedSlotWithMaxBelowSlotLimit()
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
68 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
69 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem(3);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
70 equip.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
71 UnitType unitType = equip.EquipmentForUnit;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
72 unitType.AddEquipmentSlot(SLOT_NAME, new AbsoluteNumericLimit(5));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
73 Unit unit = GetUnit(unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
74 Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
75 Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
76 Assert.AreEqual(3.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
18
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
77 }
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
78
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
79 [Test()]
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
80 public void TestGetEquipmentCountsForFixedLimitItemOnNumberLimitedSlotWithMaxBelowSlotLimitWithDifferentMinLimit()
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
81 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
82 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem(1, 3);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
83 equip.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
84 UnitType unitType = equip.EquipmentForUnit;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
85 unitType.AddEquipmentSlot(SLOT_NAME, new AbsoluteNumericLimit(5));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
86 Unit unit = GetUnit(unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
87 Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
88 Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
89 Assert.AreEqual(3.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
90 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
91
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
92 [Test()]
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
93 public void TestGetEquipmentCountsForFixedLimitItemOnPercentageLimitedSlot()
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
94 {
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
95 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem(10);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
96 equip.SlotName = SLOT_NAME;
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
97 UnitType unitType = equip.EquipmentForUnit;
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
98 unitType.AddEquipmentSlot(SLOT_NAME, new SimpleRoundedPercentageLimit(50, false));
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
99 Unit unit = GetUnit(unitType);
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
100 Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
101 Assert.AreEqual(7, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
102 Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
103 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
104
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
105 [Test()]
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
106 public void TestGetEquipmentCountsForFixedLimitItemOnPercentageLimitedSlotWithDifferentMinLimit()
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
107 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
108 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem(5, 10);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
109 equip.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
110 UnitType unitType = equip.EquipmentForUnit;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
111 unitType.AddEquipmentSlot(SLOT_NAME, new SimpleRoundedPercentageLimit(50, false));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
112 Unit unit = GetUnit(unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
113 Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
114 Assert.AreEqual(5, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
115 Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
116 }
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
117
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
118 [Test()]
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
119 public void TestGetEquipmentCountsForFixedLimitItemOnNumberLimitedSlotWithExistingEquipment()
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
120 {
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
121 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem(3);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
122 equip.SlotName = SLOT_NAME;
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
123 UnitType unitType = equip.EquipmentForUnit;
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
124 unitType.AddEquipmentSlot(SLOT_NAME, new AbsoluteNumericLimit(6));
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
125 Unit unit =GetUnit(unitType);
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
126 UnitEquipmentItem equip2 = new MockPercentageAmountUnitEquipmentItem(new MockEquipmentItem("equip2"), unitType);
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
127 equip2.SlotName = SLOT_NAME;
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
128 unit.SetEquipmentAmount(equip2, 5);
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
129 Assert.AreEqual(1, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
130 Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
131 Assert.AreEqual(1.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
132 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
133
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
134 [Test()]
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
135 public void TestGetEquipmentCountsForFixedLimitItemOnNumberLimitedSlotWithExistingEquipmentDifferentMinLimit()
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
136 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
137 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem(1, 3);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
138 equip.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
139 UnitType unitType = equip.EquipmentForUnit;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
140 unitType.AddEquipmentSlot(SLOT_NAME, new AbsoluteNumericLimit(7));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
141 Unit unit =GetUnit(unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
142 UnitEquipmentItem equip2 = new MockPercentageAmountUnitEquipmentItem(new MockEquipmentItem("equip2"), unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
143 equip2.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
144 unit.SetEquipmentAmount(equip2, 5);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
145 Assert.AreEqual(2, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
146 Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
147 Assert.AreEqual(2.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
148 }
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
149
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
150 [Test()]
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
151 public void TestGetEquipmentCountsForPercentageLimitItemOnDefaultSlot()
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
152 {
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
153 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem(50);
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
154 UnitType unitType = equip.EquipmentForUnit;
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
155 Unit unit = GetUnit(unitType);
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
156 Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
157 Assert.AreEqual(7, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
158 Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
159 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
160
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
161 [Test()]
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
162 public void TestGetEquipmentCountsForPercentageLimitItemOnDefaultSlotWithDifferentMinLimit()
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
163 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
164 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem(25, 50);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
165 UnitType unitType = equip.EquipmentForUnit;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
166 Unit unit = GetUnit(unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
167 Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
168 Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
169 Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
170 }
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
171
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
172 [Test()]
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
173 public void TestGetEquipmentCountsForPercentageLimitItemOnNumberLimitedSlot()
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
174 {
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
175 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem(50);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
176 equip.SlotName = SLOT_NAME;
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
177 UnitType unitType = equip.EquipmentForUnit;
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
178 unitType.AddEquipmentSlot(SLOT_NAME, new AbsoluteNumericLimit(2));
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
179 Unit unit = GetUnit(unitType);
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
180 Assert.AreEqual(2, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
181 Assert.AreEqual(2, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
182 Assert.AreEqual(2.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
183 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
184
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
185 [Test()]
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
186 public void TestGetEquipmentCountsForPercentageLimitItemOnNumberLimitedSlotWithDifferentMinLimit()
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
187 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
188 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem(10, 50);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
189 equip.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
190 UnitType unitType = equip.EquipmentForUnit;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
191 unitType.AddEquipmentSlot(SLOT_NAME, new AbsoluteNumericLimit(2));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
192 Unit unit = GetUnit(unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
193 Assert.AreEqual(2, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
194 Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
195 Assert.AreEqual(2.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
196 }
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
197
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
198 [Test()]
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
199 public void TestGetEquipmentCountsForPercentageLimitItemOnPercentageLimitedSlot()
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
200 {
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
201 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem(50);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
202 equip.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
203 UnitType unitType = equip.EquipmentForUnit;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
204 unitType.AddEquipmentSlot(SLOT_NAME, new SimpleRoundedPercentageLimit(25, false));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
205 Unit unit = GetUnit(unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
206 Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
207 Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
208 Assert.AreEqual(25, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
209 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
210
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
211 [Test()]
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
212 public void TestGetEquipmentCountsForPercentageLimitItemOnPercentageLimitedSlotWithDifferentMinLimit()
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
213 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
214 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem(10, 50);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
215 equip.SlotName = SLOT_NAME;
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
216 UnitType unitType = equip.EquipmentForUnit;
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
217 unitType.AddEquipmentSlot(SLOT_NAME, new SimpleRoundedPercentageLimit(25, false));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
218 Unit unit = GetUnit(unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
219 Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
220 Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
221 Assert.AreEqual(25, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
222 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
223
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
224 [Test()]
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
225 public void TestGetEquipmentCountsForPercentageLimitItemOnPercentageLimitedSlotWithMaxBelowSlotLimit()
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
226 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
227 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem(50);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
228 equip.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
229 UnitType unitType = equip.EquipmentForUnit;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
230 unitType.AddEquipmentSlot(SLOT_NAME, new SimpleRoundedPercentageLimit(75, false));
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
231 Unit unit = GetUnit(unitType);
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
232 Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
233 Assert.AreEqual(7, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
234 Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
235 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
236
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
237 [Test()]
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
238 public void TestGetEquipmentCountsForPercentageLimitItemOnPercentageLimitedSlotWithMaxBelowSlotLimitWithDifferentMinLimit()
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
239 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
240 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem(25, 50);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
241 equip.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
242 UnitType unitType = equip.EquipmentForUnit;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
243 unitType.AddEquipmentSlot(SLOT_NAME, new SimpleRoundedPercentageLimit(75, false));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
244 Unit unit = GetUnit(unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
245 Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
246 Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
247 Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
248 }
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
249
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
250 [Test()]
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
251 public void TestGetEquipmentCountsForPercentageLimitItemOnNumberLimitedSlotWithExistingEquipment()
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
252 {
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
253 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem(50);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
254 equip.SlotName = SLOT_NAME;
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
255 UnitType unitType = equip.EquipmentForUnit;
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
256 unitType.AddEquipmentSlot(SLOT_NAME, new AbsoluteNumericLimit(7));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
257 Unit unit = GetUnit(unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
258 UnitEquipmentItem equip2 = new MockPercentageAmountUnitEquipmentItem(new MockEquipmentItem("equip2"), unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
259 equip2.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
260 unit.SetEquipmentAmount(equip2, 5);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
261 Assert.AreEqual(2, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
262 Assert.AreEqual(2, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
263 Assert.AreEqual(2.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
264 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
265
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
266 [Test()]
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
267 public void TestGetEquipmentCountsForPercentageLimitItemOnPercentageLimitedSlotWithExistingEquipment()
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
268 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
269 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem(50);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
270 equip.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
271 UnitType unitType = equip.EquipmentForUnit;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
272 unitType.AddEquipmentSlot(SLOT_NAME, new SimpleRoundedPercentageLimit(50, true));
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
273 Unit unit = GetUnit(unitType);
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
274 UnitEquipmentItem equip2 = new MockPercentageAmountUnitEquipmentItem(new MockEquipmentItem("equip2"), unitType);
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
275 equip2.SlotName = SLOT_NAME;
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
276 unit.SetEquipmentAmount(equip2, 5);
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
277 Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
278 Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
279 Assert.AreEqual(3.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
280 }
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
281
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
282 [Test()]
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
283 public void TestGetEquipmentCountsForPercentageLimitItemOnPercentageLimitedSlotWithExistingEquipmentWithDifferentMinimum()
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
284 {
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
285 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem(10, 50);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
286 equip.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
287 UnitType unitType = equip.EquipmentForUnit;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
288 unitType.AddEquipmentSlot(SLOT_NAME, new SimpleRoundedPercentageLimit(50, true));
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
289 Unit unit = GetUnit(unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
290 UnitEquipmentItem equip2 = new MockPercentageAmountUnitEquipmentItem(new MockEquipmentItem("equip2"), unitType);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
291 equip2.SlotName = SLOT_NAME;
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
292 unit.SetEquipmentAmount(equip2, 5);
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
293 Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
21
40a2fd337907 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
294 Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
295 Assert.AreEqual(3.0/15*100, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
21
40a2fd337907 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 19
diff changeset
296 }
22
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
297
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
298 [Test()]
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
299 public void TestIsEquipmentRatioLimitsWithRatioLimitedEquipmentAndUnlimitedSlot()
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
300 {
23
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
301 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem();
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
302 equip.SlotName = SLOT_NAME;
22
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
303 UnitType unitType = equip.EquipmentForUnit;
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
304 unitType.AddEquipmentSlot(SLOT_NAME, new UnlimitedLimit());
22
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
305 Unit unit = GetUnit(unitType);
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
306 Assert.IsTrue(UnitEquipmentUtil.IsEquipmentRatioLimited(unit, equip));
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
307 }
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
308
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
309 [Test()]
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
310 public void TestIsEquipmentRatioLimitsWithRatioLimitedEquipmentAndRatioSlot()
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
311 {
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
312 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem();
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
313 equip.SlotName = SLOT_NAME;
22
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
314 UnitType unitType = equip.EquipmentForUnit;
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
315 unitType.AddEquipmentSlot(SLOT_NAME, new SimpleRoundedPercentageLimit(50, true));
22
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
316 Unit unit = GetUnit(unitType);
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
317 Assert.IsTrue(UnitEquipmentUtil.IsEquipmentRatioLimited(unit, equip));
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
318 }
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
319
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
320 [Test()]
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
321 public void TestIsEquipmentRatioLimitsWithRatioLimitedEquipmentAndAbsoluteSlot()
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
322 {
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
323 UnitEquipmentItem equip = new MockPercentageAmountUnitEquipmentItem();
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
324 equip.SlotName = SLOT_NAME;
22
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
325 UnitType unitType = equip.EquipmentForUnit;
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
326 unitType.AddEquipmentSlot(SLOT_NAME, new AbsoluteNumericLimit(5));
22
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
327 Unit unit = GetUnit(unitType);
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
328 Assert.IsFalse(UnitEquipmentUtil.IsEquipmentRatioLimited(unit, equip));
25b21f564348 Re #198: Add equipment slot
IBBoard <dev@ibboard.co.uk>
parents: 21
diff changeset
329 }
23
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
330
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
331 [Test()]
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
332 public void TestIsEquipmentRatioLimitsWithAbsoluteLimitedEquipmentAndAbsoluteSlot()
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
333 {
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
334 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem();
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
335 equip.SlotName = SLOT_NAME;
23
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
336 UnitType unitType = equip.EquipmentForUnit;
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
337 unitType.AddEquipmentSlot(SLOT_NAME, new AbsoluteNumericLimit(5));
23
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
338 Unit unit = GetUnit(unitType);
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
339 Assert.IsFalse(UnitEquipmentUtil.IsEquipmentRatioLimited(unit, equip));
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
340 }
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
341
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
342 [Test()]
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
343 public void TestIsEquipmentRatioLimitsWithAbsoluteLimitedEquipmentAndUnlimitedSlot()
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
344 {
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
345 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem();
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
346 equip.SlotName = SLOT_NAME;
23
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
347 UnitType unitType = equip.EquipmentForUnit;
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
348 unitType.AddEquipmentSlot(SLOT_NAME, new UnlimitedLimit());
23
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
349 Unit unit = GetUnit(unitType);
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
350 Assert.IsFalse(UnitEquipmentUtil.IsEquipmentRatioLimited(unit, equip));
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
351 }
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
352
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
353 [Test()]
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
354 public void TestIsEquipmentRatioLimitsWithAbsoluteLimitedEquipmentAndRatioSlot()
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
355 {
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
356 UnitEquipmentItem equip = new MockNumericAmountUnitEquipmentItem();
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
357 equip.SlotName = SLOT_NAME;
23
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
358 UnitType unitType = equip.EquipmentForUnit;
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
359 unitType.AddEquipmentSlot(SLOT_NAME, new SimpleRoundedPercentageLimit(50, true));
23
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
360 Unit unit = GetUnit(unitType);
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
361 Assert.IsFalse(UnitEquipmentUtil.IsEquipmentRatioLimited(unit, equip));
54abb61b9db8 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 22
diff changeset
362 }
24
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
363
92db6f6a6b0b Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 23
diff changeset
364 private Unit GetUnit (UnitType unitType)
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
365 {
26
e6bf9b5e1b94 Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 25
diff changeset
366 return new Unit ("unit", "Test Unit", 15, unitType, new MockArmyCategory (unitType.MainCategory));
19
9b23e72ba3cf Re #198: Add equipment slots
IBBoard <dev@ibboard.co.uk>
parents: 18
diff changeset
367 }
18
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
368 }
e8e7554fb7f3 Re #198: Add slots with count
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
369 }