Exemple #1
0
        public void MarkingNonExisitingCompleteReturnFalse()
        {
            IToDoRepository repository = new ToDoRepository();
            var             ToDoItem   = new ToDoItem(" Groceries ");
            var             ToDoItem2  = new ToDoItem(" Groceries 1");

            repository.Add(ToDoItem);
            Assert.AreEqual(false, repository.MarkAsCompleted(ToDoItem2.Id));
        }
Exemple #2
0
        public void MarkingExisitingCompleteWillCompleteIt()
        {
            IToDoRepository repository = new ToDoRepository();
            var             ToDoItem   = new ToDoItem(" Groceries ");

            repository.Add(ToDoItem);
            ToDoItem.IsCompleted   = true;
            ToDoItem.DateCompleted = DateTime.Now;
            Assert.AreEqual(true, repository.MarkAsCompleted(ToDoItem.Id));
            Assert.AreEqual(ToDoItem, repository.Get(ToDoItem.Id));
        }