public void SetLast() { TestCollection list = new TestCollection(); list.Add(new TestItem()); list.Add(new TestItem()); TestItem oldItem = new TestItem(); list.Add(oldItem); TestItem newItem = new TestItem(); list[2] = newItem; Assert.AreEqual(3, list.Count, "List should have 3 items"); Assert.AreEqual(newItem, list[2], "Last item should be newItem"); Assert.AreEqual(true, list.ContainsDeleted(oldItem), "Deleted list should have old item"); }
public void SetLast() { IDataPortal <TestCollection> dataPortal = _testDIContext.CreateDataPortal <TestCollection>(); IDataPortal <TestItem> childDataPortal = _testDIContext.CreateDataPortal <TestItem>(); TestCollection list = dataPortal.Create(); list.Add(childDataPortal.Create()); list.Add(childDataPortal.Create()); TestItem oldItem = childDataPortal.Create(); list.Add(oldItem); TestItem newItem = childDataPortal.Create(); list[2] = newItem; Assert.AreEqual(3, list.Count, "List should have 3 items"); Assert.AreEqual(newItem, list[2], "Last item should be newItem"); Assert.AreEqual(true, list.ContainsDeleted(oldItem), "Deleted list should have old item"); }