Ejemplo n.º 1
0
        public void TestAreComparableViaProperties()
        {
            Assert.IsFalse(ObjectUtility.AreComparableViaProperties(null, null));
            Assert.IsFalse(ObjectUtility.AreComparableViaProperties(new object(), null));

            Assert.IsFalse(ObjectUtility.AreComparableViaProperties(new AClass(), new BClass()));
            Assert.IsFalse(ObjectUtility.AreComparableViaProperties(new ASubclass(), new BSubclass()));
            Assert.IsTrue(ObjectUtility.AreComparableViaProperties(new AClass(), new AClass()));
            Assert.IsTrue(ObjectUtility.AreComparableViaProperties(new AClass(), new ASubclass()));

            Assert.IsFalse(ObjectUtility.AreComparableViaProperties(new IntAClass(), new IntBClass()));
            Assert.IsTrue(ObjectUtility.AreComparableViaProperties(new IntAClass(), new MultifacedClass()));
        }