changeset 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 82cd08385bfe
children feb77f3287ca
files API/Objects/UnitTest.cs
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line diff
     1.1 --- a/API/Objects/UnitTest.cs	Thu Dec 24 20:14:28 2009 +0000
     1.2 +++ b/API/Objects/UnitTest.cs	Sat Feb 27 14:26:19 2010 +0000
     1.3 @@ -5,6 +5,7 @@
     1.4  using System;
     1.5  using NUnit.Framework;
     1.6  using IBBoard.WarFoundry.API.Objects.Mock;
     1.7 +using IBBoard.WarFoundry.API.Util;
     1.8  using IBBoard.Limits;
     1.9  
    1.10  namespace IBBoard.WarFoundry.API.Objects
    1.11 @@ -20,8 +21,8 @@
    1.12  			UnitType unitType = equip.EquipmentForUnit;
    1.13  			Unit unit = new Unit("unit", "Test Unit", 10, unitType, new MockArmyCategory(unitType.MainCategory));
    1.14  			unit.SetEquipmentAmount(equip, 5);
    1.15 -			Assert.AreEqual(5, unit.GetEquipmentAmount(equip));
    1.16 -			Assert.IsFalse(unit.GetEquipmentAmountIsRatio(equip));
    1.17 +			Assert.AreEqual(5, UnitEquipmentUtil.GetEquipmentAmount(unit, equip));
    1.18 +			Assert.IsFalse(UnitEquipmentUtil.GetEquipmentAmountIsRatio(unit, equip));
    1.19  		}
    1.20  		
    1.21  		[Test()]
    1.22 @@ -32,7 +33,7 @@
    1.23  			Unit unit = new Unit("unit", "Test Unit", 10, unitType, new MockArmyCategory(unitType.MainCategory));
    1.24  			unit.SetEquipmentAmount(equip, 5);
    1.25  			unit.SetEquipmentAmount(equip, 0);
    1.26 -			Assert.AreEqual(0, unit.GetEquipmentAmount(equip));
    1.27 +			Assert.AreEqual(0, UnitEquipmentUtil.GetEquipmentAmount(unit, equip));
    1.28  		}
    1.29  		
    1.30  		[Test()]
    1.31 @@ -42,8 +43,8 @@
    1.32  			UnitType unitType = equip.EquipmentForUnit;
    1.33  			Unit unit = new Unit("unit", "Test Unit", 10, unitType, new MockArmyCategory(unitType.MainCategory));
    1.34  			unit.SetEquipmentRatio(equip, 50);
    1.35 -			Assert.AreEqual(50, unit.GetEquipmentAmount(equip));
    1.36 -			Assert.IsTrue(unit.GetEquipmentAmountIsRatio(equip));
    1.37 +			Assert.AreEqual(50, UnitEquipmentUtil.GetEquipmentAmount(unit, equip));
    1.38 +			Assert.IsTrue(UnitEquipmentUtil.GetEquipmentAmountIsRatio(unit, equip));
    1.39  		}
    1.40  		
    1.41  		[Test()]
    1.42 @@ -54,7 +55,7 @@
    1.43  			Unit unit = new Unit("unit", "Test Unit", 10, unitType, new MockArmyCategory(unitType.MainCategory));
    1.44  			unit.SetEquipmentRatio(equip, 50);
    1.45  			unit.SetEquipmentRatio(equip, 0);
    1.46 -			Assert.AreEqual(0, unit.GetEquipmentAmount(equip));
    1.47 +			Assert.AreEqual(0, UnitEquipmentUtil.GetEquipmentAmount(unit, equip));
    1.48  		}
    1.49  		
    1.50  		[Test()]
    1.51 @@ -65,8 +66,8 @@
    1.52  			Unit unit = new Unit("unit", "Test Unit", 5, unitType, new MockArmyCategory(unitType.MainCategory));
    1.53  			unit.Size = 5;
    1.54  			unit.SetEquipmentAmount(equip, 2);
    1.55 -			Assert.AreEqual(2, unit.GetEquipmentAmount(equip));
    1.56 -			Assert.IsFalse(unit.GetEquipmentAmountIsRatio(equip));
    1.57 +			Assert.AreEqual(2, UnitEquipmentUtil.GetEquipmentAmount(unit, equip));
    1.58 +			Assert.IsFalse(UnitEquipmentUtil.GetEquipmentAmountIsRatio(unit, equip));
    1.59  		}
    1.60  		
    1.61  		[Test()]
    1.62 @@ -77,7 +78,7 @@
    1.63  			Unit unit = new Unit("unit", "Test Unit", 5, unitType, new MockArmyCategory(unitType.MainCategory));
    1.64  			unit.SetEquipmentAmount(equip, 2);
    1.65  			unit.SetEquipmentAmount(equip, 0);
    1.66 -			Assert.AreEqual(0, unit.GetEquipmentAmount(equip));
    1.67 +			Assert.AreEqual(0, UnitEquipmentUtil.GetEquipmentAmount(unit, equip));
    1.68  		}
    1.69  		
    1.70  		[Test()]