changeset 30:0cc21db8d60a

Re #208: equipment slot issues * Make sure that all "min percentage" tests are testing for the lesser of the min percentage or the numeric min as a percentage
author IBBoard <dev@ibboard.co.uk>
date Fri, 06 Nov 2009 20:49:17 +0000
parents 29e81f10bb8b
children c6082e4018f7
files API/Util/UnitEquipmentUtilTest.cs
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line diff
     1.1 --- a/API/Util/UnitEquipmentUtilTest.cs	Fri Nov 06 20:05:29 2009 +0000
     1.2 +++ b/API/Util/UnitEquipmentUtilTest.cs	Fri Nov 06 20:49:17 2009 +0000
     1.3 @@ -107,7 +107,7 @@
     1.4  			Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
     1.5  			Assert.AreEqual(7, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
     1.6  			Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
     1.7 -			Assert.AreEqual(50, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
     1.8 +			Assert.AreEqual(IBBMath.Percentage(7, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
     1.9  		}
    1.10  		
    1.11  		[Test()]
    1.12 @@ -182,7 +182,7 @@
    1.13  			Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
    1.14  			Assert.AreEqual(7, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
    1.15  			Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
    1.16 -			Assert.AreEqual(50, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.17 +			Assert.AreEqual(IBBMath.Percentage(7, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.18  		}
    1.19  		
    1.20  		[Test()]
    1.21 @@ -194,7 +194,7 @@
    1.22  			Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
    1.23  			Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
    1.24  			Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
    1.25 -			Assert.AreEqual(25, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.26 +			Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.27  		}
    1.28  		
    1.29  		[Test()]
    1.30 @@ -208,6 +208,7 @@
    1.31  			Assert.AreEqual(2, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
    1.32  			Assert.AreEqual(2, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
    1.33  			Assert.AreEqual(IBBMath.Percentage(2, 15), UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
    1.34 +			Assert.AreEqual(IBBMath.Percentage(2, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.35  		}
    1.36  		
    1.37  		[Test()]
    1.38 @@ -235,7 +236,7 @@
    1.39  			Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
    1.40  			Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
    1.41  			Assert.AreEqual(25, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
    1.42 -			Assert.AreEqual(25, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.43 +			Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.44  		}
    1.45  		
    1.46  		[Test()]
    1.47 @@ -249,7 +250,7 @@
    1.48  			Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
    1.49  			Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
    1.50  			Assert.AreEqual(25, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
    1.51 -			Assert.AreEqual(10, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.52 +			Assert.AreEqual(IBBMath.Percentage(1, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.53  		}
    1.54  		
    1.55  		[Test()]
    1.56 @@ -263,7 +264,7 @@
    1.57  			Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
    1.58  			Assert.AreEqual(7, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
    1.59  			Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
    1.60 -			Assert.AreEqual(50, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.61 +			Assert.AreEqual(IBBMath.Percentage(7, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.62  		}
    1.63  		
    1.64  		[Test()]
    1.65 @@ -277,7 +278,7 @@
    1.66  			Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
    1.67  			Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
    1.68  			Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
    1.69 -			Assert.AreEqual(25, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.70 +			Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.71  		}
    1.72  		
    1.73  		[Test()]
    1.74 @@ -309,7 +310,7 @@
    1.75  			Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
    1.76  			Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
    1.77  			Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
    1.78 -			Assert.AreEqual(10, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.79 +			Assert.AreEqual(IBBMath.Percentage(1, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.80  		}
    1.81  		
    1.82  		[Test()]
    1.83 @@ -326,7 +327,7 @@
    1.84  			Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
    1.85  			Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
    1.86  			Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
    1.87 -			Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.88 +			Assert.AreEqual(50 - IBBMath.Percentage(5, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.89  		}
    1.90  		
    1.91  		[Test()]
    1.92 @@ -341,7 +342,7 @@
    1.93  			Assert.AreEqual(7, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
    1.94  			Assert.AreEqual(1, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
    1.95  			Assert.AreEqual(50, UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
    1.96 -			Assert.AreEqual(10, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.97 +			Assert.AreEqual(IBBMath.Percentage(1, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
    1.98  		}
    1.99  		
   1.100  		[Test()]