Exemplo n.º 1
0
        public void TwoConsWithSameElementsAreEqual()
        {
            Cons cons1 = new Cons(1, new Cons(2, new Cons(3)));
            Cons cons2 = new Cons(1, new Cons(2, new Cons(3)));

            Assert.IsTrue(cons1.Equals(cons2));
            Assert.IsTrue(cons2.Equals(cons1));
        }
Exemplo n.º 2
0
        public void TwoConsWithDifferentElementsAreNotEqual()
        {
            Cons cons1 = new Cons(1, new Cons(2, new Cons(3)));
            Cons cons2 = new Cons(3, new Cons(2, new Cons(1)));

            Assert.IsFalse(cons1.Equals(cons2));
            Assert.IsFalse(cons2.Equals(cons1));
        }