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 wrap: on
line diff
--- a/API/Util/UnitEquipmentUtilTest.cs	Fri Nov 06 20:05:29 2009 +0000
+++ b/API/Util/UnitEquipmentUtilTest.cs	Fri Nov 06 20:49:17 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(50, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
+			Assert.AreEqual(IBBMath.Percentage(7, 15), 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(50, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
+			Assert.AreEqual(IBBMath.Percentage(7, 15), 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(25, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
+			Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
 		}
 		
 		[Test()]
@@ -208,6 +208,7 @@
 			Assert.AreEqual(2, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
 			Assert.AreEqual(2, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
 			Assert.AreEqual(IBBMath.Percentage(2, 15), UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
+			Assert.AreEqual(IBBMath.Percentage(2, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
 		}
 		
 		[Test()]
@@ -235,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(25, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
+			Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
 		}
 		
 		[Test()]
@@ -249,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(10, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
+			Assert.AreEqual(IBBMath.Percentage(1, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
 		}
 		
 		[Test()]
@@ -263,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(50, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
+			Assert.AreEqual(IBBMath.Percentage(7, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
 		}
 		
 		[Test()]
@@ -277,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(25, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
+			Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
 		}
 		
 		[Test()]
@@ -309,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(10, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
+			Assert.AreEqual(IBBMath.Percentage(1, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
 		}
 		
 		[Test()]
@@ -326,7 +327,7 @@
 			Assert.AreEqual(3, UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip));
 			Assert.AreEqual(3, UnitEquipmentUtil.GetMinEquipmentCount(unit, equip));
 			Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
-			Assert.AreEqual(IBBMath.Percentage(3, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
+			Assert.AreEqual(50 - IBBMath.Percentage(5, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
 		}
 		
 		[Test()]
@@ -341,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(10, UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
+			Assert.AreEqual(IBBMath.Percentage(1, 15), UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
 		}
 		
 		[Test()]