changeset 140:2ae80631ec9c

* Remove duplicate equality test code now that Mike Krueger fixed MonoDevelop bug 677228 (https://bugzilla.novell.com/show_bug.cgi?id=677228#c5) no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Thu, 28 Apr 2011 13:36:16 +0000
parents 3e4864e206ea
children cd95fc6400b2
files API/Objects/GameSystemTest.cs API/Objects/RaceTests.cs API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs API/Objects/Requirement/RequiresNoMoreThanNOfUnitTypeRequirementTest.cs API/Objects/Requirement/UnitCountRequirementDataTest.cs API/Objects/UnitTypeTest.cs
diffstat 6 files changed, 1 insertions(+), 270 deletions(-) [+]
line diff
     1.1 --- a/API/Objects/GameSystemTest.cs	Tue Apr 26 19:47:36 2011 +0000
     1.2 +++ b/API/Objects/GameSystemTest.cs	Thu Apr 28 13:36:16 2011 +0000
     1.3 @@ -10,51 +10,6 @@
     1.4  	[TestFixture()]
     1.5  	public class GameSystemTest : AbstractEqualityTest<GameSystem>
     1.6  	{
     1.7 -		//FIXME We shouldn't duplicate these tests, but it is broken at the moment
     1.8 -		[Test]
     1.9 -		public void TestEquality()
    1.10 -		{
    1.11 -			Assert.AreEqual(GetObject(), GetSameObject());
    1.12 -			Assert.AreEqual(GetSameObject(), GetObject());
    1.13 -		}
    1.14 -
    1.15 -		[Test]
    1.16 -		public void TestInequality()
    1.17 -		{
    1.18 -			Assert.AreNotEqual(GetObject(), GetDifferentObject());
    1.19 -			Assert.AreNotEqual(GetSameObject(), GetDifferentObject());
    1.20 -			Assert.AreNotEqual(GetDifferentObject(), GetObject());
    1.21 -			Assert.AreNotEqual(GetDifferentObject(), GetSameObject());
    1.22 -		}
    1.23 -
    1.24 -		[Test]
    1.25 -		public void TestReflexiveEquality()
    1.26 -		{
    1.27 -			Assert.AreEqual(GetObject(), GetObject());
    1.28 -			Assert.AreEqual(GetSameObject(), GetSameObject());
    1.29 -			Assert.AreEqual(GetDifferentObject(), GetDifferentObject());
    1.30 -		}
    1.31 -
    1.32 -		[Test]
    1.33 -		public void TestOtherInequality()
    1.34 -		{
    1.35 -			MethodInfo[] methodInfo = GetType().GetMethods();
    1.36 -			GameSystem obj = GetObject();
    1.37 -
    1.38 -			foreach (MethodInfo method in methodInfo)
    1.39 -			{
    1.40 -				if (method.Name.StartsWith("GetOtherDifferent"))
    1.41 -				{
    1.42 -					GameSystem otherObj = (GameSystem)method.Invoke(this, new object[0]);
    1.43 -					Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name);
    1.44 -					Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name);
    1.45 -				}
    1.46 -			}
    1.47 -		}
    1.48 -
    1.49 -
    1.50 -
    1.51 -
    1.52  		[Test()]
    1.53  		public void TestPointsSingularAbbreviation ()
    1.54  		{
     2.1 --- a/API/Objects/RaceTests.cs	Tue Apr 26 19:47:36 2011 +0000
     2.2 +++ b/API/Objects/RaceTests.cs	Thu Apr 28 13:36:16 2011 +0000
     2.3 @@ -16,51 +16,6 @@
     2.4  	[TestFixture()]
     2.5  	public class RaceTests : AbstractEqualityTest<Race>
     2.6  	{
     2.7 -		//FIXME We shouldn't duplicate these tests, but it is broken at the moment
     2.8 -		[Test]
     2.9 -		public void TestEquality()
    2.10 -		{
    2.11 -			Assert.AreEqual(GetObject(), GetSameObject());
    2.12 -			Assert.AreEqual(GetSameObject(), GetObject());
    2.13 -		}
    2.14 -
    2.15 -		[Test]
    2.16 -		public void TestInequality()
    2.17 -		{
    2.18 -			Assert.AreNotEqual(GetObject(), GetDifferentObject());
    2.19 -			Assert.AreNotEqual(GetSameObject(), GetDifferentObject());
    2.20 -			Assert.AreNotEqual(GetDifferentObject(), GetObject());
    2.21 -			Assert.AreNotEqual(GetDifferentObject(), GetSameObject());
    2.22 -		}
    2.23 -
    2.24 -		[Test]
    2.25 -		public void TestReflexiveEquality()
    2.26 -		{
    2.27 -			Assert.AreEqual(GetObject(), GetObject());
    2.28 -			Assert.AreEqual(GetSameObject(), GetSameObject());
    2.29 -			Assert.AreEqual(GetDifferentObject(), GetDifferentObject());
    2.30 -		}
    2.31 -
    2.32 -		[Test]
    2.33 -		public void TestOtherInequality()
    2.34 -		{
    2.35 -			MethodInfo[] methodInfo = GetType().GetMethods();
    2.36 -			Race obj = GetObject();
    2.37 -
    2.38 -			foreach (MethodInfo method in methodInfo)
    2.39 -			{
    2.40 -				if (method.Name.StartsWith("GetOtherDifferent"))
    2.41 -				{
    2.42 -					Race otherObj = (Race)method.Invoke(this, new object[0]);
    2.43 -					Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name);
    2.44 -					Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name);
    2.45 -				}
    2.46 -			}
    2.47 -		}
    2.48 -
    2.49 -
    2.50 -
    2.51 -
    2.52  		[Test()]
    2.53  		public void TestRaceWithNoUnitTypesHasNoRequirements()
    2.54  		{
     3.1 --- a/API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs	Tue Apr 26 19:47:36 2011 +0000
     3.2 +++ b/API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs	Thu Apr 28 13:36:16 2011 +0000
     3.3 @@ -14,51 +14,6 @@
     3.4  	[TestFixture()]
     3.5  	public class RequiresAtLeastNUnitsRequirementTest : AbstractEqualityTest<RequiresAtLeastNUnitsRequirement>
     3.6  	{
     3.7 -		//FIXME We shouldn't duplicate these tests, but it is broken at the moment
     3.8 -		[Test]
     3.9 -		public void TestEquality()
    3.10 -		{
    3.11 -			Assert.AreEqual(GetObject(), GetSameObject());
    3.12 -			Assert.AreEqual(GetSameObject(), GetObject());
    3.13 -		}
    3.14 -
    3.15 -		[Test]
    3.16 -		public void TestInequality()
    3.17 -		{
    3.18 -			Assert.AreNotEqual(GetObject(), GetDifferentObject());
    3.19 -			Assert.AreNotEqual(GetSameObject(), GetDifferentObject());
    3.20 -			Assert.AreNotEqual(GetDifferentObject(), GetObject());
    3.21 -			Assert.AreNotEqual(GetDifferentObject(), GetSameObject());
    3.22 -		}
    3.23 -
    3.24 -		[Test]
    3.25 -		public void TestReflexiveEquality()
    3.26 -		{
    3.27 -			Assert.AreEqual(GetObject(), GetObject());
    3.28 -			Assert.AreEqual(GetSameObject(), GetSameObject());
    3.29 -			Assert.AreEqual(GetDifferentObject(), GetDifferentObject());
    3.30 -		}
    3.31 -
    3.32 -		[Test]
    3.33 -		public void TestOtherInequality()
    3.34 -		{
    3.35 -			MethodInfo[] methodInfo = GetType().GetMethods();
    3.36 -			RequiresAtLeastNUnitsRequirement obj = GetObject();
    3.37 -
    3.38 -			foreach (MethodInfo method in methodInfo)
    3.39 -			{
    3.40 -				if (method.Name.StartsWith("GetOtherDifferent"))
    3.41 -				{
    3.42 -					RequiresAtLeastNUnitsRequirement otherObj = (RequiresAtLeastNUnitsRequirement)method.Invoke(this, new object[0]);
    3.43 -					Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name);
    3.44 -					Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name);
    3.45 -				}
    3.46 -			}
    3.47 -		}
    3.48 -
    3.49 -
    3.50 -
    3.51 -
    3.52  		private MockRace mockRace;
    3.53  		private UnitType unitType1;
    3.54  		private UnitType unitType2;
     4.1 --- a/API/Objects/Requirement/RequiresNoMoreThanNOfUnitTypeRequirementTest.cs	Tue Apr 26 19:47:36 2011 +0000
     4.2 +++ b/API/Objects/Requirement/RequiresNoMoreThanNOfUnitTypeRequirementTest.cs	Thu Apr 28 13:36:16 2011 +0000
     4.3 @@ -14,51 +14,6 @@
     4.4  	[TestFixture()]
     4.5  	public class RequiresNoMoreThanNOfUnitTypeRequirementTest : AbstractEqualityTest<RequiresNoMoreThanNOfUnitTypeRequirement>
     4.6  	{
     4.7 -		//FIXME We shouldn't duplicate these tests, but it is broken at the moment
     4.8 -		[Test]
     4.9 -		public void TestEquality()
    4.10 -		{
    4.11 -			Assert.AreEqual(GetObject(), GetSameObject());
    4.12 -			Assert.AreEqual(GetSameObject(), GetObject());
    4.13 -		}
    4.14 -
    4.15 -		[Test]
    4.16 -		public void TestInequality()
    4.17 -		{
    4.18 -			Assert.AreNotEqual(GetObject(), GetDifferentObject());
    4.19 -			Assert.AreNotEqual(GetSameObject(), GetDifferentObject());
    4.20 -			Assert.AreNotEqual(GetDifferentObject(), GetObject());
    4.21 -			Assert.AreNotEqual(GetDifferentObject(), GetSameObject());
    4.22 -		}
    4.23 -
    4.24 -		[Test]
    4.25 -		public void TestReflexiveEquality()
    4.26 -		{
    4.27 -			Assert.AreEqual(GetObject(), GetObject());
    4.28 -			Assert.AreEqual(GetSameObject(), GetSameObject());
    4.29 -			Assert.AreEqual(GetDifferentObject(), GetDifferentObject());
    4.30 -		}
    4.31 -
    4.32 -		[Test]
    4.33 -		public void TestOtherInequality()
    4.34 -		{
    4.35 -			MethodInfo[] methodInfo = GetType().GetMethods();
    4.36 -			RequiresNoMoreThanNOfUnitTypeRequirement obj = GetObject();
    4.37 -
    4.38 -			foreach (MethodInfo method in methodInfo)
    4.39 -			{
    4.40 -				if (method.Name.StartsWith("GetOtherDifferent"))
    4.41 -				{
    4.42 -					RequiresAtLeastNUnitsRequirement otherObj = (RequiresAtLeastNUnitsRequirement)method.Invoke(this, new object[0]);
    4.43 -					Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name);
    4.44 -					Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name);
    4.45 -				}
    4.46 -			}
    4.47 -		}
    4.48 -
    4.49 -
    4.50 -
    4.51 -
    4.52  		private MockRace mockRace;
    4.53  		private UnitType unitType1;
    4.54  		private UnitType unitType2;
     5.1 --- a/API/Objects/Requirement/UnitCountRequirementDataTest.cs	Tue Apr 26 19:47:36 2011 +0000
     5.2 +++ b/API/Objects/Requirement/UnitCountRequirementDataTest.cs	Thu Apr 28 13:36:16 2011 +0000
     5.3 @@ -12,51 +12,7 @@
     5.4  {
     5.5  	[TestFixture()]
     5.6  	public class UnitCountRequirementDataTest : AbstractEqualityTest<UnitCountRequirementData>
     5.7 -	{
     5.8 -		//FIXME We shouldn't duplicate these tests, but it is broken at the moment
     5.9 -		[Test]
    5.10 -		public void TestEquality()
    5.11 -		{
    5.12 -			Assert.AreEqual(GetObject(), GetSameObject());
    5.13 -			Assert.AreEqual(GetSameObject(), GetObject());
    5.14 -		}
    5.15 -
    5.16 -		[Test]
    5.17 -		public void TestInequality()
    5.18 -		{
    5.19 -			Assert.AreNotEqual(GetObject(), GetDifferentObject());
    5.20 -			Assert.AreNotEqual(GetSameObject(), GetDifferentObject());
    5.21 -			Assert.AreNotEqual(GetDifferentObject(), GetObject());
    5.22 -			Assert.AreNotEqual(GetDifferentObject(), GetSameObject());
    5.23 -		}
    5.24 -
    5.25 -		[Test]
    5.26 -		public void TestReflexiveEquality()
    5.27 -		{
    5.28 -			Assert.AreEqual(GetObject(), GetObject());
    5.29 -			Assert.AreEqual(GetSameObject(), GetSameObject());
    5.30 -			Assert.AreEqual(GetDifferentObject(), GetDifferentObject());
    5.31 -		}
    5.32 -
    5.33 -		[Test]
    5.34 -		public void TestOtherInequality()
    5.35 -		{
    5.36 -			MethodInfo[] methodInfo = GetType().GetMethods();
    5.37 -			UnitCountRequirementData obj = GetObject();
    5.38 -
    5.39 -			foreach (MethodInfo method in methodInfo)
    5.40 -			{
    5.41 -				if (method.Name.StartsWith("GetOtherDifferent"))
    5.42 -				{
    5.43 -					UnitCountRequirementData otherObj = (UnitCountRequirementData)method.Invoke(this, new object[0]);
    5.44 -					Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name);
    5.45 -					Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name);
    5.46 -				}
    5.47 -			}
    5.48 -		}
    5.49 -
    5.50 -
    5.51 -
    5.52 +	{
    5.53  		public override UnitCountRequirementData GetObject ()
    5.54  		{
    5.55  			return new UnitCountRequirementData(new MockUnitType(), 1);
     6.1 --- a/API/Objects/UnitTypeTest.cs	Tue Apr 26 19:47:36 2011 +0000
     6.2 +++ b/API/Objects/UnitTypeTest.cs	Thu Apr 28 13:36:16 2011 +0000
     6.3 @@ -15,51 +15,6 @@
     6.4  	[TestFixture()]
     6.5  	public class UnitTypeTest : AbstractEqualityTest<UnitType>
     6.6  	{
     6.7 -		//FIXME We shouldn't duplicate these tests, but it is broken at the moment
     6.8 -		[Test]
     6.9 -		public void TestEquality()
    6.10 -		{
    6.11 -			Assert.AreEqual(GetObject(), GetSameObject());
    6.12 -			Assert.AreEqual(GetSameObject(), GetObject());
    6.13 -		}
    6.14 -
    6.15 -		[Test]
    6.16 -		public void TestInequality()
    6.17 -		{
    6.18 -			Assert.AreNotEqual(GetObject(), GetDifferentObject());
    6.19 -			Assert.AreNotEqual(GetSameObject(), GetDifferentObject());
    6.20 -			Assert.AreNotEqual(GetDifferentObject(), GetObject());
    6.21 -			Assert.AreNotEqual(GetDifferentObject(), GetSameObject());
    6.22 -		}
    6.23 -
    6.24 -		[Test]
    6.25 -		public void TestReflexiveEquality()
    6.26 -		{
    6.27 -			Assert.AreEqual(GetObject(), GetObject());
    6.28 -			Assert.AreEqual(GetSameObject(), GetSameObject());
    6.29 -			Assert.AreEqual(GetDifferentObject(), GetDifferentObject());
    6.30 -		}
    6.31 -
    6.32 -		[Test]
    6.33 -		public void TestOtherInequality()
    6.34 -		{
    6.35 -			MethodInfo[] methodInfo = GetType().GetMethods();
    6.36 -			UnitType obj = GetObject();
    6.37 -
    6.38 -			foreach (MethodInfo method in methodInfo)
    6.39 -			{
    6.40 -				if (method.Name.StartsWith("GetOtherDifferent"))
    6.41 -				{
    6.42 -					UnitType otherObj = (UnitType)method.Invoke(this, new object[0]);
    6.43 -					Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name);
    6.44 -					Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name);
    6.45 -				}
    6.46 -			}
    6.47 -		}
    6.48 -
    6.49 -
    6.50 -
    6.51 -
    6.52  		[Test()]
    6.53  		public void TestSettingMainCategorySetsCategoriesCollection()
    6.54  		{