public void Remove_ItemFromEmptyList_ReturnNull() { //Arrange RakList <string> list = new RakList <string>(); //Act list.Remove("value"); string actualValue = list[0]; //Assert Assert.AreEqual(null, actualValue); }
public void Remove_NoItemExists_IndexRemainsSame() { //Arrange RakList <int> list = new RakList <int> { 0, 1, 2, 3, 4 }; int input = 5; //Act list.Remove(input); //Asser2 Assert.AreEqual(3, list[3]); }
public void Remove_ItemExists_CheckIndex() { //Arrange RakList <int> list = new RakList <int> { 0, 1, 2, 3, 4 }; int input = 2; //Act list.Remove(input); int expectedValue = 3; //Assert Assert.AreEqual(expectedValue, list[2]); }
public void Remove_NoItemExists_ReturnFalse() { //Arrange RakList <int> list = new RakList <int> { 0, 1, 2, 3, 4 }; int input = 5; bool foundItem; //Act list.Remove(input); foundItem = false; //Assert Assert.IsFalse(foundItem); }
public void Remove_MoreThanOneItemExists_ChecksCount() { //Arrange RakList <string> list = new RakList <string>() { "alpha", "bravo", "charlie", "delta", "echo", "alpha" }; int expectedValue = 4; //Act list.Remove("alpha"); //test that count goes down Assert.AreEqual(expectedValue, list.Count); }
public void Remove_NoItemExists() { //Arrange RakList <int> list = new RakList <int>() { 0, 1, 2, 3, 4 }; int input = 5; //Act list.Remove(input); int actualValue = list.Count; int expectedValue = 5; //Assert //remove something that doesn't exist count remains same Assert.AreEqual(expectedValue, actualValue); }