Mercurial > repos > IBDev-IBBoard.WarFoundry.API.Tests
comparison API/Objects/Requirement/RequiresAtLeastNUnitsRequirementTest.cs @ 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 | 11faab6c712a |
children | cd95fc6400b2 |
comparison
equal
deleted
inserted
replaced
139:3e4864e206ea | 140:2ae80631ec9c |
---|---|
12 namespace IBBoard.WarFoundry.API.Objects.Requirement | 12 namespace IBBoard.WarFoundry.API.Objects.Requirement |
13 { | 13 { |
14 [TestFixture()] | 14 [TestFixture()] |
15 public class RequiresAtLeastNUnitsRequirementTest : AbstractEqualityTest<RequiresAtLeastNUnitsRequirement> | 15 public class RequiresAtLeastNUnitsRequirementTest : AbstractEqualityTest<RequiresAtLeastNUnitsRequirement> |
16 { | 16 { |
17 //FIXME We shouldn't duplicate these tests, but it is broken at the moment | |
18 [Test] | |
19 public void TestEquality() | |
20 { | |
21 Assert.AreEqual(GetObject(), GetSameObject()); | |
22 Assert.AreEqual(GetSameObject(), GetObject()); | |
23 } | |
24 | |
25 [Test] | |
26 public void TestInequality() | |
27 { | |
28 Assert.AreNotEqual(GetObject(), GetDifferentObject()); | |
29 Assert.AreNotEqual(GetSameObject(), GetDifferentObject()); | |
30 Assert.AreNotEqual(GetDifferentObject(), GetObject()); | |
31 Assert.AreNotEqual(GetDifferentObject(), GetSameObject()); | |
32 } | |
33 | |
34 [Test] | |
35 public void TestReflexiveEquality() | |
36 { | |
37 Assert.AreEqual(GetObject(), GetObject()); | |
38 Assert.AreEqual(GetSameObject(), GetSameObject()); | |
39 Assert.AreEqual(GetDifferentObject(), GetDifferentObject()); | |
40 } | |
41 | |
42 [Test] | |
43 public void TestOtherInequality() | |
44 { | |
45 MethodInfo[] methodInfo = GetType().GetMethods(); | |
46 RequiresAtLeastNUnitsRequirement obj = GetObject(); | |
47 | |
48 foreach (MethodInfo method in methodInfo) | |
49 { | |
50 if (method.Name.StartsWith("GetOtherDifferent")) | |
51 { | |
52 RequiresAtLeastNUnitsRequirement otherObj = (RequiresAtLeastNUnitsRequirement)method.Invoke(this, new object[0]); | |
53 Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name); | |
54 Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name); | |
55 } | |
56 } | |
57 } | |
58 | |
59 | |
60 | |
61 | |
62 private MockRace mockRace; | 17 private MockRace mockRace; |
63 private UnitType unitType1; | 18 private UnitType unitType1; |
64 private UnitType unitType2; | 19 private UnitType unitType2; |
65 private UnitType unitType3; | 20 private UnitType unitType3; |
66 | 21 |