diff API/Objects/UnitEquipmentItemTest.cs @ 19:9b23e72ba3cf

Re #198: Add equipment slots * Fix unit tests
author IBBoard <dev@ibboard.co.uk>
date Tue, 27 Oct 2009 20:00:54 +0000
parents ca5d7c2c7493
children beaf7a48a93f
line wrap: on
line diff
--- a/API/Objects/UnitEquipmentItemTest.cs	Sat Oct 24 18:59:30 2009 +0000
+++ b/API/Objects/UnitEquipmentItemTest.cs	Tue Oct 27 20:00:54 2009 +0000
@@ -4,6 +4,7 @@
 
 using System;
 using NUnit.Framework;
+using IBBoard.Limits;
 using IBBoard.WarFoundry.API.Objects.Mock;
 
 namespace IBBoard.WarFoundry.API.Objects
@@ -11,6 +12,7 @@
 	[TestFixture()]
 	public class UnitEquipmentItemTest
 	{
+		/*
 		[Test()]
 		public void DefaultMinMaxNumberLimitsAreZero()
 		{
@@ -136,5 +138,21 @@
 			item.MinPercentage = 50;
 			item.MaxPercentage = 50;
 		}
+		*/
+		[Test()]
+		public void TestSettingOnlyMinLimitSetsMatchingMaxLimit()
+		{
+			UnitEquipmentItem item = new UnitEquipmentItem(new MockEquipmentItem(), new MockUnitType());
+			item.MinLimit = new UnlimitedLimit();
+			Assert.AreEqual(item.MinLimit, item.MaxLimit);
+		}
+		
+		[Test()]
+		public void TestSettingOnlyMaxLimitSetsMatchingMinLimit()
+		{
+			UnitEquipmentItem item = new UnitEquipmentItem(new MockEquipmentItem(), new MockUnitType());
+			item.MaxLimit = new UnlimitedLimit();
+			Assert.AreEqual(item.MaxLimit, item.MinLimit);
+		}
 	}
 }