# HG changeset patch # User IBBoard # Date 1258108189 0 # Node ID c6082e4018f7ff23d7c552fa6a826332fc8a91a2 # Parent 0cc21db8d60ab8e3d09d97612accf5e5e35efa6b Re #209: equipmentslot Value problem * Update unit tests to match new "check percentage, ignore numbers" min percentage calculation diff -r 0cc21db8d60a -r c6082e4018f7 API/Util/UnitEquipmentUtilTest.cs --- a/API/Util/UnitEquipmentUtilTest.cs Fri Nov 06 20:49:17 2009 +0000 +++ b/API/Util/UnitEquipmentUtilTest.cs Fri Nov 13 10:29:49 2009 +0000 @@ -107,7 +107,7 @@ Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip)); Assert.AreEqual(7, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip)); Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip)); - Assert.AreEqual(IBBMath.Percentage(7, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); + Assert.AreEqual(50, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); } [Test()] @@ -182,7 +182,7 @@ Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip)); Assert.AreEqual(7, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip)); Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip)); - Assert.AreEqual(IBBMath.Percentage(7, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); + Assert.AreEqual(50, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); } [Test()] @@ -194,7 +194,7 @@ Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip)); Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip)); Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip)); - Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); + Assert.AreEqual(25, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); } [Test()] @@ -222,7 +222,7 @@ Assert.AreEqual(2, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip)); Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip)); Assert.AreEqual(IBBMath.Percentage(2, 15), UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip)); - Assert.AreEqual(IBBMath.Percentage(1, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); + Assert.AreEqual(10, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); } [Test()] @@ -236,7 +236,7 @@ Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip)); Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip)); Assert.AreEqual(25, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip)); - Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); + Assert.AreEqual(25, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); } [Test()] @@ -250,7 +250,7 @@ Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip)); Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip)); Assert.AreEqual(25, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip)); - Assert.AreEqual(IBBMath.Percentage(1, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); + Assert.AreEqual(10, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); } [Test()] @@ -264,7 +264,7 @@ Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip)); Assert.AreEqual(7, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip)); Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip)); - Assert.AreEqual(IBBMath.Percentage(7, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); + Assert.AreEqual(50, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); } [Test()] @@ -278,7 +278,7 @@ Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip)); Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip)); Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip)); - Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); + Assert.AreEqual(25, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); } [Test()] @@ -310,7 +310,7 @@ Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip)); Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip)); Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip)); - Assert.AreEqual(IBBMath.Percentage(1, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); + Assert.AreEqual(10, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); } [Test()] @@ -342,7 +342,7 @@ Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip)); Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip)); Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip)); - Assert.AreEqual(IBBMath.Percentage(1, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); + Assert.AreEqual(10, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); } [Test()] @@ -359,7 +359,7 @@ Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip)); Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip)); Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip)); - Assert.AreEqual(IBBMath.Percentage(1, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); + Assert.AreEqual(10, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip)); } [Test()]