comparison API/Objects/UnitTest.cs @ 14:19fc7a733064

Re #198: Add slots with counts to units * Start testing unit * Add more mock objects * Make MockUnitType define its category
author IBBoard <dev@ibboard.co.uk>
date Fri, 23 Oct 2009 19:57:03 +0000
parents
children 1119b6f48e8e
comparison
equal deleted inserted replaced
13:ca5d7c2c7493 14:19fc7a733064
1 // This file (UnitTest.cs) is a part of the IBBoard.WarFoundry.API.Tests project and is copyright 2009 IBBoard
2 //
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.
4
5 using System;
6 using NUnit.Framework;
7 using IBBoard.WarFoundry.API.Objects.Mock;
8
9 namespace IBBoard.WarFoundry.API.Objects
10 {
11 [TestFixture()]
12 public class UnitTest
13 {
14 [Test()]
15 public void TestAddSlotEquipmentAddsEquipmentSelection()
16 {
17 UnitEquipmentItem equip = new MockUnitEquipmentItem();
18 UnitType unitType = equip.EquipmentForUnit;
19 Unit unit = new Unit(unitType, new MockArmyCategory(unitType.MainCategory));
20 unit.SetEquipmentAmount(equip, WarFoundryCore.INFINITY);
21 Assert.AreEqual(WarFoundryCore.INFINITY, unit.GetEquipmentAmount(equip));
22 Assert.IsFalse(unit.GetEquipmentAmountIsRatio(equip));
23 }
24 }
25 }