public void TestInsertItemExisting() { SvgList list2 = makeList(); object o1 = makeItem(); object o2 = makeItem(); object o3 = makeItem(); object o4 = makeItem(); list.AppendItem(o1); list.AppendItem(o2); list.AppendItem(o3); list2.AppendItem(o4); list2.InsertItemBefore(o2, 0); Assert.AreEqual(2, list.NumberOfItems); Assert.AreEqual(2, list2.NumberOfItems); Assert.AreSame(o1, list.GetItem(0)); Assert.AreSame(o3, list.GetItem(1)); Assert.AreSame(o2, list2.GetItem(0)); Assert.AreSame(o4, list2.GetItem(1)); }
public bool MoveNext() { bool result = false; index++; if (index < list.NumberOfItems) { current = list.GetItem((uint)index); result = true; } return(result); }
public void TestAppendItemExisting() { SvgList list2 = makeList(); object o1 = makeItem(); object o2 = makeItem(); list.AppendItem(o1); list.AppendItem(o2); list2.AppendItem(o1); Assert.AreEqual(1, list.NumberOfItems); Assert.AreEqual(1, list2.NumberOfItems); Assert.AreSame(o2, list.GetItem(0)); Assert.AreSame(o1, list2.GetItem(0)); }
public void TestInitializeGetItem() { // make sure initialized list's first item is item used in initialize call object o1 = makeItem(); list.Initialize(o1); Assert.AreSame(o1, list.GetItem(0)); }