Пример #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));
        }
Пример #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));
        }