Пример #1
0
        public void ComparingObjectsWithCircularReferencesShouldNotFail()
        {
            var object1 = new NonBuiltInClassAllowingCircularReference();

            object1.Inner = object1;

            var object2 = new NonBuiltInClassAllowingCircularReference();

            object2.Inner = object2;

            var result = comparer.AreEqual(object1, object2);

            Assert.IsTrue(result.AreEqual, "Objects should be equal and result returned despite circular reference.");
        }
Пример #2
0
        public void ComparingObjectsWithCircularReferencesShouldNotFail()
        {
            var object1 = new NonBuiltInClassAllowingCircularReference();
            object1.Inner = object1;

            var object2 = new NonBuiltInClassAllowingCircularReference();
            object2.Inner = object2;

            var result = comparer.AreEqual(object1, object2);

            Assert.IsTrue(result.AreEqual, "Objects should be equal and result returned despite circular reference.");
        }