public void Remove_RemoveFromMiddle_ListRemainsFlush() { // Assign XanderList <int> testList = new XanderList <int>(); testList.Add(1); testList.Add(2); testList.Add(3); testList.Add(4); testList.Add(5); testList.Add(6); testList.Add(7); testList.Add(8); testList.Add(9); testList.Add(10); int expected = 8; int actual; // Act testList.Remove(7); actual = testList[6]; // Assert Assert.AreEqual(expected, actual); }
public void Remove_ElementDoesNotExist_ReturnFalse() { // Arrange XanderList <int> testList = new XanderList <int>(); testList.Add(88); testList.Add(3); testList.Add(99); bool expected = false; bool actual; // Act actual = testList.Remove(13); // Assert Assert.AreEqual(expected, actual); }
public void Remove_RemoveOnlyValue_CountIsZero() { // Assign int expected; int actual; XanderList <int> testList = new XanderList <int>(); testList.Add(1); // Act expected = 0; testList.Remove(1); actual = testList.Count; // Assert Assert.AreEqual(expected, actual); }
public void Remove_RemoveElementFromList_ReturnTrue() { // Arrange XanderList <int> testList = new XanderList <int>(); testList.Add(1); testList.Add(2); testList.Add(3); testList.Add(4); bool expected = true; bool actual; // Act actual = testList.Remove(3); // Assert Assert.AreEqual(expected, actual); }
public void Remove_ElementNotInList_CountInNotDecremented() { // Arrange int expected; int actual; XanderList <int> testList = new XanderList <int>(); testList.Add(1); testList.Add(2); testList.Add(3); // Act testList.Remove(7); expected = 3; actual = testList.Count; // Assert }
public void Remove_RemoveElementWithValue_CountIsDecremented() { // Arrange XanderList <int> testList = new XanderList <int>(); testList.Add(666); testList.Add(920); testList.Add(777); int expected = 2; int actual; // Act testList.Remove(666); actual = testList.Count;; // Assert Assert.AreEqual(expected, actual); }
public void Remove_RemoveLastIndex_LastIndexIsRemoved() { // Assign int expected; int actual; XanderList <int> testList = new XanderList <int>(); testList.Add(1); testList.Add(2); // Act expected = 1; testList.Remove(2); actual = testList[0]; // Assert Assert.AreEqual(expected, actual); }