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)); }
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)); }