public void DListRemoveTest() { int[] arr = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; DList <int> list = new DList <int>(arr); list.Remove(1); Assert.AreEqual(9, list.Count); Assert.AreEqual(2, list[0]); list.Remove(10); Assert.AreEqual(8, list.Count); Assert.AreEqual(9, list[7]); }
public void Remove() { var list = new DList <int> { 0, 1, 2 }; list.Remove(item => item == 1).ShouldBe(1); list.ShouldBe(new[] { 0, 2 }); list.Remove(1); list.ShouldBe(new[] { 0 }); }