comparison API/Objects/GameSystemTest.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 081b48413f6d
children
comparison
equal deleted inserted replaced
139:3e4864e206ea 140:2ae80631ec9c
8 namespace IBBoard.WarFoundry.API.Objects 8 namespace IBBoard.WarFoundry.API.Objects
9 { 9 {
10 [TestFixture()] 10 [TestFixture()]
11 public class GameSystemTest : AbstractEqualityTest<GameSystem> 11 public class GameSystemTest : AbstractEqualityTest<GameSystem>
12 { 12 {
13 //FIXME We shouldn't duplicate these tests, but it is broken at the moment
14 [Test]
15 public void TestEquality()
16 {
17 Assert.AreEqual(GetObject(), GetSameObject());
18 Assert.AreEqual(GetSameObject(), GetObject());
19 }
20
21 [Test]
22 public void TestInequality()
23 {
24 Assert.AreNotEqual(GetObject(), GetDifferentObject());
25 Assert.AreNotEqual(GetSameObject(), GetDifferentObject());
26 Assert.AreNotEqual(GetDifferentObject(), GetObject());
27 Assert.AreNotEqual(GetDifferentObject(), GetSameObject());
28 }
29
30 [Test]
31 public void TestReflexiveEquality()
32 {
33 Assert.AreEqual(GetObject(), GetObject());
34 Assert.AreEqual(GetSameObject(), GetSameObject());
35 Assert.AreEqual(GetDifferentObject(), GetDifferentObject());
36 }
37
38 [Test]
39 public void TestOtherInequality()
40 {
41 MethodInfo[] methodInfo = GetType().GetMethods();
42 GameSystem obj = GetObject();
43
44 foreach (MethodInfo method in methodInfo)
45 {
46 if (method.Name.StartsWith("GetOtherDifferent"))
47 {
48 GameSystem otherObj = (GameSystem)method.Invoke(this, new object[0]);
49 Assert.AreNotEqual(obj, otherObj, "Objects equal for "+method.Name);
50 Assert.AreNotEqual(otherObj, obj, "Objects equal for "+method.Name);
51 }
52 }
53 }
54
55
56
57
58 [Test()] 13 [Test()]
59 public void TestPointsSingularAbbreviation () 14 public void TestPointsSingularAbbreviation ()
60 { 15 {
61 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory()); 16 GameSystem system = new GameSystem("id", "name", new DummyWarFoundryFactory());
62 Assert.That(system.GetPointsAbbrev(1), Is.EqualTo("")); 17 Assert.That(system.GetPointsAbbrev(1), Is.EqualTo(""));