public bool MarkAsCompleted(Guid todoId) { TodoItem todoItem = Get(todoId); if (todoItem == null) { return(false); } return(todoItem.MarkAsCompleted()); }
public void GetCompletedGetsCompletedItems() { List <TodoItem> list = new List <TodoItem>(); ITodoRepository repository = new TodoRepository(); TodoItem item2016 = new TodoItem("2016"); TodoItem item2017 = new TodoItem("2017"); TodoItem item2018 = new TodoItem("2018"); item2018.MarkAsCompleted(); list.Add(item2018); repository.Add(item2016); repository.Add(item2017); repository.Add(item2018); List <TodoItem> completed = repository.GetCompleted(); Assert.IsTrue(list.SequenceEqual(completed)); }
public bool MarkAsCompleted(Guid todoId) { TodoItem item = this.Get(todoId); return(item.MarkAsCompleted()); }