public void RemovingExisitingWillRemoveIt() { IToDoRepository repository = new ToDoRepository(); var ToDoItem = new ToDoItem(" Groceries "); var ToDoItem2 = new ToDoItem(" Groceries1 "); repository.Add(ToDoItem); repository.Add(ToDoItem2); Assert.AreEqual(true, repository.Remove(ToDoItem.Id)); Assert.AreEqual(1, repository.GetAll().Count); }
public void RemovingNonExisitingWillReturnFalse() { IToDoRepository repository = new ToDoRepository(); var ToDoItem = new ToDoItem(" Groceries "); var ToDoItem2 = new ToDoItem(" Groceries1 "); var ToDoItem3 = new ToDoItem(" Groceries2 "); repository.Add(ToDoItem); repository.Add(ToDoItem2); Assert.AreEqual(false, repository.Remove(ToDoItem3.Id)); Assert.AreEqual(2, repository.GetAll().Count); }