public void CreateTodoCommandValid() { var command = new CreateTodoCommand("title", DateTime.Now, "userbygoogle"); command.Validate(); Assert.True(command.Valid); }
public void CreateTodoCommandInvalidTitle() { var command = new CreateTodoCommand("ti", DateTime.Now, "userbygoogle"); command.Validate(); Assert.False(command.Valid); }
public void TodoHandlerFail() { _invalidCommand.Validate(); var result = (GenericCommandResult)_handler.Handle(_invalidCommand); Assert.AreEqual(result.Success, false); }
public void TodoHandlerSuccess() { _validCommand.Validate(); var result = (GenericCommandResult)_handler.Handle(_validCommand); Assert.AreEqual(result.Success, true); }
public void CreateTodoCommandInvalidUser() { var command = new CreateTodoCommand("title", DateTime.Now, ""); command.Validate(); Assert.False(command.Valid); }
public void CreateTodoCommand_TodoValido_DeveRetornarTodo() { var command = new CreateTodoCommand("Teste", "kelvin", DateTime.Now); command.Validate(); Assert.True(command.Valid); }
public void Dado_um_command_valido() { var command = new CreateTodoCommand("titulo da tarefa", DateTime.Now, "Matheus Rodrigues"); command.Validate(); Assert.AreEqual(command.Valid, true); }
public void GivenAValidcommand() { var command = new CreateTodoCommand("Study CSharp", "leandropicoli", DateTime.Now.AddDays(2)); command.Validate(); Assert.IsTrue(command.Valid); }
public void GivenAnInvalidCommand() { var command = new CreateTodoCommand("", "", DateTime.Now); command.Validate(); Assert.IsTrue(command.Invalid); }
public CreateCommandTests() { _invalidComand = new CreateTodoCommand("", "", DateTime.Now); _invalidComand.Validate(); _validComand = new CreateTodoCommand("criando tarefa", "douglas", DateTime.Now); _validComand.Validate(); }
public void DadoUmComandoValido() { var command = new CreateTodoCommand("Titulo Tarefa", DateTime.Now, "Usuário"); command.Validate(); Assert.AreEqual(command.Valid, true); }
public void CreateTodoCommand_TodoInvalido_DeveRetornarErros() { var command = new CreateTodoCommand("", "", DateTime.Now); command.Validate(); Assert.False(command.Valid); //testar quantidade de notificações }
public void Dado_um_command_invalido() { var command = new CreateTodoCommand("", DateTime.Now, ""); command.Validate(); Assert.AreEqual(command.Valid, false); }
public TodoQueryTests() { _validCommand.Validate(); _invalidCommand.Validate(); _items = new List <TodoItem>(); _items.Add(new TodoItem("TAREFA 1", DateTime.Now, "Batman")); _items.Add(new TodoItem("TAREFA 2", DateTime.Now, "Robin")); _items.Add(new TodoItem("TAREFA 3", DateTime.Now, "SuperMan")); }
public ICommandResult Handle(CreateTodoCommand command) { //fail fast validation command.Validate(); if (!command.IsValid) { return(new GenericCommandResult(false, "Ops, sua tarefa está errada", command.Notifications)); } //gera o TodoItem var todo = new TodoItem(command.Title, command.Date, command.User); //salva no banco _repository.Create(todo); return(new GenericCommandResult(true, "Tarefa salva", todo)); }
public CreateTodoCommandTests() { _invalidCommand.Validate(); _validCommand.Validate(); }
public void Dado_um_comando_valido() { _validCommand.Validate(); Assert.AreEqual(_validCommand.Valid, true); }
public void Dado_um_comando_invalido() { _invalidCommand.Validate(); Assert.AreEqual(_invalidCommand.Valid, false); }
public CreateTodoHandlerTests() { _validCommand.Validate(); _invalidCommand.Validate(); }
public void Dado_um_commando_invalido() { _invalidCommand.Validate(); Assert.False(_invalidCommand.Valid); }
public void Dado_um_commando_valido() { _validCommand.Validate(); Assert.True(_validCommand.Valid); }
public void CommandValid() { _validCommand.Validate(); Assert.AreEqual(_validCommand.Valid, true); }
public void CommandInvalid() { _invalidCommand.Validate(); Assert.AreEqual(_invalidCommand.Valid, false); }
public UnitTest1() { _invalidCommand.Validate(); _validCommand.Validate(); }
public CreateTodoCommandTest() { _createCommandInvalid.Validate(); _createCommandValid.Validate(); }