public void TestClone() { IntListContainer list1 = new IntListContainer(1, 2, 3, 4, 5, 6, 7); IntListContainer clone = list1.Clone; Assert.IsTrue(list1.Equals(clone)); list1[0] = 100; Assert.IsFalse(list1.Equals(clone)); }
public void TestEquals() { IntListContainer lw1 = new IntListContainer(0, 1, 2, 3, 3, 4); IntListContainer lw2 = new IntListContainer(0, 6, 7); Assert.AreNotEqual(lw1.list, lw2.list); Assert.AreNotEqual(lw1, lw2); Assert.IsFalse(lw1.Equals(lw2)); lw1 = new IntListContainer(0, 1, 2, 3, 3, 4, 5, 5, 6, 7); lw2 = new IntListContainer(0, 1, 2, 3, 3, 4, 5, 5, 6, 7); Assert.AreEqual(lw1.list, lw2.list); Assert.AreEqual(lw1, lw2); Assert.IsTrue(lw1.Equals(lw2)); }