public void testAddOne() { Edit e = new Edit(1, 2, 1, 1); EditList l = new EditList(); l.Add(e); Assert.AreEqual(1, l.size()); Assert.IsFalse(l.isEmpty()); Assert.AreSame(e, l.get(0)); IEnumerator i = l.GetEnumerator(); i.Reset(); i.MoveNext(); Assert.AreSame(e, i.Current); Assert.IsTrue(l.Equals(l)); Assert.IsFalse(l.Equals(new EditList())); EditList l2 = new EditList(); l2.Add(e); Assert.IsTrue(l.Equals(l2)); Assert.IsTrue(l2.Equals(l)); Assert.AreEqual(l.GetHashCode(), l2.GetHashCode()); }
public void testEmpty() { EditList l = new EditList(); Assert.AreEqual(0, l.size()); Assert.IsTrue(l.isEmpty()); Assert.AreEqual("EditList[]", l.ToString()); Assert.IsTrue(l.Equals(l)); Assert.IsTrue(l.Equals(new EditList())); Assert.IsFalse(l.Equals(string.Empty)); Assert.AreEqual(l.GetHashCode(), new EditList().GetHashCode()); }