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 testAddTwo() { Edit e1 = new Edit(1, 2, 1, 1); Edit e2 = new Edit(8, 8, 8, 12); EditList l = new EditList(); l.Add(e1); l.Add(e2); Assert.AreEqual(2, l.size()); Assert.AreSame(e1, l.get(0)); Assert.AreSame(e2, l.get(1)); IEnumerator i = l.GetEnumerator(); i.Reset(); i.MoveNext(); Assert.AreSame(e1, i.Current); i.MoveNext(); Assert.AreSame(e2, i.Current); Assert.IsTrue(l.Equals(l)); Assert.IsFalse(l.Equals(new EditList())); EditList l2 = new EditList(); l2.Add(e1); l2.Add(e2); Assert.IsTrue(l.Equals(l2)); Assert.IsTrue(l2.Equals(l)); Assert.AreEqual(l.GetHashCode(), l2.GetHashCode()); }
public virtual void TestEmpty() { EditList l = new EditList(); NUnit.Framework.Assert.AreEqual(0, l.Count); NUnit.Framework.Assert.IsTrue(l.IsEmpty()); NUnit.Framework.Assert.AreEqual("EditList[]", l.ToString()); NUnit.Framework.Assert.AreEqual(l, l); NUnit.Framework.Assert.AreEqual(new EditList(), l); NUnit.Framework.Assert.IsFalse(l.Equals(string.Empty)); NUnit.Framework.Assert.AreEqual(l.GetHashCode(), new EditList().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()); }
public virtual void TestAddOne() { Edit e = new Edit(1, 2, 1, 1); EditList l = new EditList(); l.AddItem(e); NUnit.Framework.Assert.AreEqual(1, l.Count); NUnit.Framework.Assert.IsFalse(l.IsEmpty()); NUnit.Framework.Assert.AreSame(e, l[0]); NUnit.Framework.Assert.AreSame(e, l.Iterator().Next()); NUnit.Framework.Assert.AreEqual(l, l); NUnit.Framework.Assert.IsFalse(l.Equals(new EditList())); EditList l2 = new EditList(); l2.AddItem(e); NUnit.Framework.Assert.AreEqual(l2, l); NUnit.Framework.Assert.AreEqual(l, l2); NUnit.Framework.Assert.AreEqual(l.GetHashCode(), l2.GetHashCode()); }
public virtual void TestAddTwo() { Edit e1 = new Edit(1, 2, 1, 1); Edit e2 = new Edit(8, 8, 8, 12); EditList l = new EditList(); l.AddItem(e1); l.AddItem(e2); NUnit.Framework.Assert.AreEqual(2, l.Count); NUnit.Framework.Assert.AreSame(e1, l[0]); NUnit.Framework.Assert.AreSame(e2, l[1]); Iterator<Edit> i = l.Iterator(); NUnit.Framework.Assert.AreSame(e1, i.Next()); NUnit.Framework.Assert.AreSame(e2, i.Next()); NUnit.Framework.Assert.AreEqual(l, l); NUnit.Framework.Assert.IsFalse(l.Equals(new EditList())); EditList l2 = new EditList(); l2.AddItem(e1); l2.AddItem(e2); NUnit.Framework.Assert.AreEqual(l2, l); NUnit.Framework.Assert.AreEqual(l, l2); NUnit.Framework.Assert.AreEqual(l.GetHashCode(), l2.GetHashCode()); }