Example #1
0
        public void TestAreSimilarReferences()
        {
            object anObject      = new object();
            object anotherObject = anObject;
            object nullObject    = null;

            Assert.IsTrue(ObjectUtility.AreSimilarReferences(anObject, anObject));
            Assert.IsTrue(ObjectUtility.AreSimilarReferences(anObject, anotherObject));

            Assert.IsTrue(ObjectUtility.AreSimilarReferences(nullObject, nullObject));
            Assert.IsTrue(ObjectUtility.AreSimilarReferences(nullObject, null));

            Assert.IsFalse(ObjectUtility.AreSimilarReferences(nullObject, anotherObject));
            Assert.IsFalse(ObjectUtility.AreSimilarReferences(anObject, new object()));
        }