public void ValidatesRemoveMethodThatReturnsFalse() { var list = new LinkedListCollection <int> { 1, 2, 3 }; Assert.False(list.Remove(4)); }
public void ArgumentNullRemoveMethodException() { var test = new LinkedListCollection <int> { 1, 2 }; LinkedListNode <int> nullNode = null; Assert.Throws <ArgumentNullException>(() => test.Remove(nullNode)); }
public void IsReadOnlyRemoveMethodException() { var test = new LinkedListCollection <int>(); test.Add(1); test.Add(2); test = test.ReadOnlyList(); Assert.Throws <NotSupportedException>(() => test.Remove(2)); }
public void ValidatesRemoveMethod() { var list = new LinkedListCollection <int> { 1, 2, 3 }; Assert.True(list.Remove(2)); Assert.Equal(1, list.GetFirst.Value); Assert.Equal(3, list.GetLast.Value); }
public void RemoveMethodInvalidOperationException() { var test = new LinkedListCollection <int> { 1, 2 }; var secondTestList = new LinkedListCollection <int> { 1, 2 }; LinkedListNode <int> node = new LinkedListNode <int>(3); secondTestList.Add(node); Assert.Throws <InvalidOperationException>(() => test.Remove(node)); }