Mercurial > repos > IBBoard.WarFoundry.API.Tests
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 wrap: on
line diff
--- a/API/Objects/GameSystemTest.cs Tue Apr 26 19:47:36 2011 +0000 +++ b/API/Objects/GameSystemTest.cs Thu Apr 28 13:36:16 2011 +0000 @@ -10,51 +10,6 @@ [TestFixture()] public class GameSystemTest : AbstractEqualityTest<GameSystem> { - //FIXME We shouldn't duplicate these tests, but it is broken at the moment - [Test] - public void TestEquality() - { - Assert.AreEqual(GetObject(), GetSameObject()); - Assert.AreEqual(GetSameObject(), GetObject()); - } - - [Test] - public void TestInequality() - { - Assert.AreNotEqual(GetObject(), GetDifferentObject()); - Assert.AreNotEqual(GetSameObject(), GetDifferentObject()); - Assert.AreNotEqual(GetDifferentObject(), GetObject()); - Assert.AreNotEqual(GetDifferentObject(), GetSameObject()); - } - - [Test] - public void TestReflexiveEquality() - { - Assert.AreEqual(GetObject(), GetObject()); - Assert.AreEqual(GetSameObject(), GetSameObject()); - Assert.AreEqual(GetDifferentObject(), GetDifferentObject()); - } - - [Test] - public void TestOtherInequality() - { - MethodInfo[] methodInfo = GetType().GetMethods(); - GameSystem obj = GetObject(); - - foreach (MethodInfo method in methodInfo) - { - if (method.Name.StartsWith("GetOtherDifferent")) - { - GameSystem otherObj = (GameSystem)method.Invoke(this, new object[0]); - Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name); - Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name); - } - } - } - - - - [Test()] public void TestPointsSingularAbbreviation () {
--- a/API/Objects/RaceTests.cs Tue Apr 26 19:47:36 2011 +0000 +++ b/API/Objects/RaceTests.cs Thu Apr 28 13:36:16 2011 +0000 @@ -16,51 +16,6 @@ [TestFixture()] public class RaceTests : AbstractEqualityTest<Race> { - //FIXME We shouldn't duplicate these tests, but it is broken at the moment - [Test] - public void TestEquality() - { - Assert.AreEqual(GetObject(), GetSameObject()); - Assert.AreEqual(GetSameObject(), GetObject()); - } - - [Test] - public void TestInequality() - { - Assert.AreNotEqual(GetObject(), GetDifferentObject()); - Assert.AreNotEqual(GetSameObject(), GetDifferentObject()); - Assert.AreNotEqual(GetDifferentObject(), GetObject()); - Assert.AreNotEqual(GetDifferentObject(), GetSameObject()); - } - - [Test] - public void TestReflexiveEquality() - { - Assert.AreEqual(GetObject(), GetObject()); - Assert.AreEqual(GetSameObject(), GetSameObject()); - Assert.AreEqual(GetDifferentObject(), GetDifferentObject()); - } - - [Test] - public void TestOtherInequality() - { - MethodInfo[] methodInfo = GetType().GetMethods(); - Race obj = GetObject(); - - foreach (MethodInfo method in methodInfo) - { - if (method.Name.StartsWith("GetOtherDifferent")) - { - Race otherObj = (Race)method.Invoke(this, new object[0]); - Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name); - Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name); - } - } - } - - - - [Test()] public void TestRaceWithNoUnitTypesHasNoRequirements() {
--- a/API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs Tue Apr 26 19:47:36 2011 +0000 +++ b/API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs Thu Apr 28 13:36:16 2011 +0000 @@ -14,51 +14,6 @@ [TestFixture()] public class RequiresAtLeastNUnitsRequirementTest : AbstractEqualityTest<RequiresAtLeastNUnitsRequirement> { - //FIXME We shouldn't duplicate these tests, but it is broken at the moment - [Test] - public void TestEquality() - { - Assert.AreEqual(GetObject(), GetSameObject()); - Assert.AreEqual(GetSameObject(), GetObject()); - } - - [Test] - public void TestInequality() - { - Assert.AreNotEqual(GetObject(), GetDifferentObject()); - Assert.AreNotEqual(GetSameObject(), GetDifferentObject()); - Assert.AreNotEqual(GetDifferentObject(), GetObject()); - Assert.AreNotEqual(GetDifferentObject(), GetSameObject()); - } - - [Test] - public void TestReflexiveEquality() - { - Assert.AreEqual(GetObject(), GetObject()); - Assert.AreEqual(GetSameObject(), GetSameObject()); - Assert.AreEqual(GetDifferentObject(), GetDifferentObject()); - } - - [Test] - public void TestOtherInequality() - { - MethodInfo[] methodInfo = GetType().GetMethods(); - RequiresAtLeastNUnitsRequirement obj = GetObject(); - - foreach (MethodInfo method in methodInfo) - { - if (method.Name.StartsWith("GetOtherDifferent")) - { - RequiresAtLeastNUnitsRequirement otherObj = (RequiresAtLeastNUnitsRequirement)method.Invoke(this, new object[0]); - Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name); - Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name); - } - } - } - - - - private MockRace mockRace; private UnitType unitType1; private UnitType unitType2;
--- a/API/Objects/Requirement/RequiresNoMoreThanNOfUnitTypeRequirementTest.cs Tue Apr 26 19:47:36 2011 +0000 +++ b/API/Objects/Requirement/RequiresNoMoreThanNOfUnitTypeRequirementTest.cs Thu Apr 28 13:36:16 2011 +0000 @@ -14,51 +14,6 @@ [TestFixture()] public class RequiresNoMoreThanNOfUnitTypeRequirementTest : AbstractEqualityTest<RequiresNoMoreThanNOfUnitTypeRequirement> { - //FIXME We shouldn't duplicate these tests, but it is broken at the moment - [Test] - public void TestEquality() - { - Assert.AreEqual(GetObject(), GetSameObject()); - Assert.AreEqual(GetSameObject(), GetObject()); - } - - [Test] - public void TestInequality() - { - Assert.AreNotEqual(GetObject(), GetDifferentObject()); - Assert.AreNotEqual(GetSameObject(), GetDifferentObject()); - Assert.AreNotEqual(GetDifferentObject(), GetObject()); - Assert.AreNotEqual(GetDifferentObject(), GetSameObject()); - } - - [Test] - public void TestReflexiveEquality() - { - Assert.AreEqual(GetObject(), GetObject()); - Assert.AreEqual(GetSameObject(), GetSameObject()); - Assert.AreEqual(GetDifferentObject(), GetDifferentObject()); - } - - [Test] - public void TestOtherInequality() - { - MethodInfo[] methodInfo = GetType().GetMethods(); - RequiresNoMoreThanNOfUnitTypeRequirement obj = GetObject(); - - foreach (MethodInfo method in methodInfo) - { - if (method.Name.StartsWith("GetOtherDifferent")) - { - RequiresAtLeastNUnitsRequirement otherObj = (RequiresAtLeastNUnitsRequirement)method.Invoke(this, new object[0]); - Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name); - Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name); - } - } - } - - - - private MockRace mockRace; private UnitType unitType1; private UnitType unitType2;
--- a/API/Objects/Requirement/UnitCountRequirementDataTest.cs Tue Apr 26 19:47:36 2011 +0000 +++ b/API/Objects/Requirement/UnitCountRequirementDataTest.cs Thu Apr 28 13:36:16 2011 +0000 @@ -12,51 +12,7 @@ { [TestFixture()] public class UnitCountRequirementDataTest : AbstractEqualityTest<UnitCountRequirementData> - { - //FIXME We shouldn't duplicate these tests, but it is broken at the moment - [Test] - public void TestEquality() - { - Assert.AreEqual(GetObject(), GetSameObject()); - Assert.AreEqual(GetSameObject(), GetObject()); - } - - [Test] - public void TestInequality() - { - Assert.AreNotEqual(GetObject(), GetDifferentObject()); - Assert.AreNotEqual(GetSameObject(), GetDifferentObject()); - Assert.AreNotEqual(GetDifferentObject(), GetObject()); - Assert.AreNotEqual(GetDifferentObject(), GetSameObject()); - } - - [Test] - public void TestReflexiveEquality() - { - Assert.AreEqual(GetObject(), GetObject()); - Assert.AreEqual(GetSameObject(), GetSameObject()); - Assert.AreEqual(GetDifferentObject(), GetDifferentObject()); - } - - [Test] - public void TestOtherInequality() - { - MethodInfo[] methodInfo = GetType().GetMethods(); - UnitCountRequirementData obj = GetObject(); - - foreach (MethodInfo method in methodInfo) - { - if (method.Name.StartsWith("GetOtherDifferent")) - { - UnitCountRequirementData otherObj = (UnitCountRequirementData)method.Invoke(this, new object[0]); - Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name); - Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name); - } - } - } - - - + { public override UnitCountRequirementData GetObject () { return new UnitCountRequirementData(new MockUnitType(), 1);
--- a/API/Objects/UnitTypeTest.cs Tue Apr 26 19:47:36 2011 +0000 +++ b/API/Objects/UnitTypeTest.cs Thu Apr 28 13:36:16 2011 +0000 @@ -15,51 +15,6 @@ [TestFixture()] public class UnitTypeTest : AbstractEqualityTest<UnitType> { - //FIXME We shouldn't duplicate these tests, but it is broken at the moment - [Test] - public void TestEquality() - { - Assert.AreEqual(GetObject(), GetSameObject()); - Assert.AreEqual(GetSameObject(), GetObject()); - } - - [Test] - public void TestInequality() - { - Assert.AreNotEqual(GetObject(), GetDifferentObject()); - Assert.AreNotEqual(GetSameObject(), GetDifferentObject()); - Assert.AreNotEqual(GetDifferentObject(), GetObject()); - Assert.AreNotEqual(GetDifferentObject(), GetSameObject()); - } - - [Test] - public void TestReflexiveEquality() - { - Assert.AreEqual(GetObject(), GetObject()); - Assert.AreEqual(GetSameObject(), GetSameObject()); - Assert.AreEqual(GetDifferentObject(), GetDifferentObject()); - } - - [Test] - public void TestOtherInequality() - { - MethodInfo[] methodInfo = GetType().GetMethods(); - UnitType obj = GetObject(); - - foreach (MethodInfo method in methodInfo) - { - if (method.Name.StartsWith("GetOtherDifferent")) - { - UnitType otherObj = (UnitType)method.Invoke(this, new object[0]); - Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name); - Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name); - } - } - } - - - - [Test()] public void TestSettingMainCategorySetsCategoriesCollection() {