public void Remove_Value_False() { var list = new DoubleCircularLinkedList <string> { "a", "b", "c" }; Assert.False(list.Remove("d")); }
public void Remove_Test_String_True() { var list = new DoubleCircularLinkedList <string> { "a", "b", "c" }; Assert.Equal(3, list.Count); list.Remove(list.First.Next); Assert.Equal("c", list.First.Next.GetData()); Assert.Equal(2, list.Count); }
public void Remove_Node_ArgumentNullException() { var list = new DoubleCircularLinkedList <string> { "a", "c", "d" }; Node <string> nullNode = null; var exception = Assert.Throws <ArgumentNullException>(() => list.Remove(nullNode)); Assert.Equal("Value cannot be null.\r\nParameter name: node", exception.Message); }
public void Remove_Value_True() { var list = new DoubleCircularLinkedList <string> { "a", "b", "c", "d", "e" }; var Expectedlist = new DoubleCircularLinkedList <string> { "a", "b", "c", "e" }; ; Assert.True(list.Remove("d")); }
public void Remove_Node_InvalidOperationException() { var list1 = new DoubleCircularLinkedList <string> { "a", "b", "c" }; var list2 = new DoubleCircularLinkedList <string> { "a", "b", }; var exception = Assert.Throws <InvalidOperationException>(() => list1.Remove(list2.Last)); Assert.Equal("Node to remove is not member of list", exception.Message); }