Example #1
0
        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;
        }
Example #3
0
        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);
        }
Example #4
0
 void AddTodoUseCase_ShouldCallAddTodoInRepository()
 {
     _useCase.Execute(title: _tTitle, description: _tDescription);
     _mockRepo.Verify(x => x.AddTodo(It.IsAny <Todo>()), Times.Once());
 }