Mercurial > repos > IBDev-IBBoard.WarFoundry.API.Tests
diff API/Objects/UnitTest.cs @ 37:bf46c113d85c
* Resolve warnings in tests
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 27 Feb 2010 14:26:19 +0000 |
parents | 9b23e72ba3cf |
children | c026c02583ca |
line wrap: on
line diff
--- a/API/Objects/UnitTest.cs Thu Dec 24 20:14:28 2009 +0000 +++ b/API/Objects/UnitTest.cs Sat Feb 27 14:26:19 2010 +0000 @@ -5,6 +5,7 @@ using System; using NUnit.Framework; using IBBoard.WarFoundry.API.Objects.Mock; +using IBBoard.WarFoundry.API.Util; using IBBoard.Limits; namespace IBBoard.WarFoundry.API.Objects @@ -20,8 +21,8 @@ UnitType unitType = equip.EquipmentForUnit; Unit unit = new Unit("unit", "Test Unit", 10, unitType, new MockArmyCategory(unitType.MainCategory)); unit.SetEquipmentAmount(equip, 5); - Assert.AreEqual(5, unit.GetEquipmentAmount(equip)); - Assert.IsFalse(unit.GetEquipmentAmountIsRatio(equip)); + Assert.AreEqual(5, UnitEquipmentUtil.GetEquipmentAmount(unit, equip)); + Assert.IsFalse(UnitEquipmentUtil.GetEquipmentAmountIsRatio(unit, equip)); } [Test()] @@ -32,7 +33,7 @@ Unit unit = new Unit("unit", "Test Unit", 10, unitType, new MockArmyCategory(unitType.MainCategory)); unit.SetEquipmentAmount(equip, 5); unit.SetEquipmentAmount(equip, 0); - Assert.AreEqual(0, unit.GetEquipmentAmount(equip)); + Assert.AreEqual(0, UnitEquipmentUtil.GetEquipmentAmount(unit, equip)); } [Test()] @@ -42,8 +43,8 @@ UnitType unitType = equip.EquipmentForUnit; Unit unit = new Unit("unit", "Test Unit", 10, unitType, new MockArmyCategory(unitType.MainCategory)); unit.SetEquipmentRatio(equip, 50); - Assert.AreEqual(50, unit.GetEquipmentAmount(equip)); - Assert.IsTrue(unit.GetEquipmentAmountIsRatio(equip)); + Assert.AreEqual(50, UnitEquipmentUtil.GetEquipmentAmount(unit, equip)); + Assert.IsTrue(UnitEquipmentUtil.GetEquipmentAmountIsRatio(unit, equip)); } [Test()] @@ -54,7 +55,7 @@ Unit unit = new Unit("unit", "Test Unit", 10, unitType, new MockArmyCategory(unitType.MainCategory)); unit.SetEquipmentRatio(equip, 50); unit.SetEquipmentRatio(equip, 0); - Assert.AreEqual(0, unit.GetEquipmentAmount(equip)); + Assert.AreEqual(0, UnitEquipmentUtil.GetEquipmentAmount(unit, equip)); } [Test()] @@ -65,8 +66,8 @@ Unit unit = new Unit("unit", "Test Unit", 5, unitType, new MockArmyCategory(unitType.MainCategory)); unit.Size = 5; unit.SetEquipmentAmount(equip, 2); - Assert.AreEqual(2, unit.GetEquipmentAmount(equip)); - Assert.IsFalse(unit.GetEquipmentAmountIsRatio(equip)); + Assert.AreEqual(2, UnitEquipmentUtil.GetEquipmentAmount(unit, equip)); + Assert.IsFalse(UnitEquipmentUtil.GetEquipmentAmountIsRatio(unit, equip)); } [Test()] @@ -77,7 +78,7 @@ Unit unit = new Unit("unit", "Test Unit", 5, unitType, new MockArmyCategory(unitType.MainCategory)); unit.SetEquipmentAmount(equip, 2); unit.SetEquipmentAmount(equip, 0); - Assert.AreEqual(0, unit.GetEquipmentAmount(equip)); + Assert.AreEqual(0, UnitEquipmentUtil.GetEquipmentAmount(unit, equip)); } [Test()]