Beispiel #1
0
        public void DocumentEquality()
        {
            XDoc x     = new XDoc("x").Elem("a", "1").Elem("b", "2");
            XDoc y     = new XDoc("x").Elem("a", "1").Elem("b", "2");
            XDoc z     = new XDoc("x").Elem("a", "1").Elem("b", "3");
            XDoc null1 = null;
            XDoc null2 = null;

            Assert.IsTrue(x.Equals(y));
            Assert.IsFalse(x.Equals(z));
            Assert.IsTrue(x == y);
            Assert.IsFalse(x == z);
            Assert.IsTrue(x != z);
            Assert.IsFalse(x != y);
            Assert.IsFalse(x.Equals(null1));
            Assert.IsFalse(x == null1);
            Assert.IsFalse(null1 == x);
            Assert.IsTrue(x != null1);
            Assert.IsTrue(null1 != x);
            Assert.IsTrue(null1 == null2);
            Assert.IsTrue(null1 == null);
            Assert.IsFalse(null1 != null2);
            Assert.IsFalse(null1 != null);
        }
Beispiel #2
0
 public static void AreEqual(XDoc expected, XDoc actual)
 {
     NUnit.Framework.Assert.IsTrue(expected.Equals(actual));
 }
Beispiel #3
0
 public static void AreEqual(XDoc expected, XDoc actual, string message)
 {
     NUnit.Framework.Assert.IsTrue(expected.Equals(actual), message);
 }
Beispiel #4
0
 public void DocumentEquality()
 {
     XDoc x = new XDoc("x").Elem("a", "1").Elem("b", "2");
     XDoc y = new XDoc("x").Elem("a", "1").Elem("b", "2");
     XDoc z = new XDoc("x").Elem("a", "1").Elem("b", "3");
     XDoc null1 = null;
     XDoc null2 = null;
     Assert.IsTrue(x.Equals(y));
     Assert.IsFalse(x.Equals(z));
     Assert.IsTrue(x == y);
     Assert.IsFalse(x == z);
     Assert.IsTrue(x != z);
     Assert.IsFalse(x != y);
     Assert.IsFalse(x.Equals(null1));
     Assert.IsFalse(x == null1);
     Assert.IsFalse(null1 == x);
     Assert.IsTrue(x != null1);
     Assert.IsTrue(null1 != x);
     Assert.IsTrue(null1 == null2);
     Assert.IsTrue(null1 == null);
     Assert.IsFalse(null1 != null2);
     Assert.IsFalse(null1 != null);
 }