static void Main(string[] args) { TodoRepository repository = new TodoRepository(); AddTodo addTodoUsecase = new AddTodo(repository); addTodoUsecase.Execute("tests title", "test description"); Console.WriteLine("Hello World!"); }
public IEnumerable<TodoItem> Add(string description) { var command = new AddTodo { Input = new AddTodoInput(description, this.ViewModel.TodoItems), Persistor = this.Persistor }; command.Execute(); ViewModel.TodoItems = command.Value.ToList(); return command.Value; }
public IEnumerable <TodoItem> Add(string description) { var command = new AddTodo { Input = new AddTodoInput(description, this.ViewModel.TodoItems), Persistor = this.Persistor }; command.Execute(); ViewModel.TodoItems = command.Value.ToList(); return(command.Value); }
void AddTodoUseCase_ShouldCallAddTodoInRepository() { _useCase.Execute(title: _tTitle, description: _tDescription); _mockRepo.Verify(x => x.AddTodo(It.IsAny <Todo>()), Times.Once()); }