Exemple #1
0
        public void MarkItemCompletedDoesNotChange()
        {
            InMemoryContext  inMemory = new InMemoryContext();
            ITodoItemGateway gateway  = new TodoItemGateway(inMemory);
            IUseCase         sut      = new MarkItemCompleted(gateway);

            sut.Execute(Guid.NewGuid());

            Assert.Empty(inMemory.TodoItems.Where(e => e.Id == existingTodoItemId && e.IsCompleted));
        }
Exemple #2
0
        public void MarkItemCompletedSuccess()
        {
            InMemoryContext  inMemory = new InMemoryContext();
            ITodoItemGateway gateway  = new TodoItemGateway(inMemory);
            IUseCase         sut      = new MarkItemCompleted(gateway);

            sut.Execute(existingTodoItemId);

            Assert.NotEmpty(inMemory.TodoItems.Where(e => e.Id == existingTodoItemId && e.IsCompleted));
        }