public async Task DeveRetornarErroSeNomeJaExisteNoBanco() { var handler = new ClienteCommandHandler(_clienteRepository, _mediator); var command = new CriarClienteCommand(_helperEntitiesTest.Nome.Nome); var retorno = await handler.Handle(command, new CancellationToken()); Assert.Equal(Guid.Empty, retorno); }
public void QuandoForSolicitadoOCadastro() { bus.RaiseEvent(Arg.Any <ClienteCadastradoEvent>()); repository.InserirCliente(Arg.Any <Application.Models.Cliente>()); var handler = new ClienteCommandHandler(bus, repository); retorno = handler.Handle(command, CancellationToken.None).Result; }
public ClientePresenter(ICadastroClienteView view, ClienteCommandHandler clienteCommand) { _view = view; _clienteCommand = clienteCommand; _view.Nome = "tste"; _view.Adicionar += executeAdicionar; _view.Remover += executeRemover; _view.Limpar += executeLimparGrid; _view.Salvar += async(s) => { await executeSalvar(s); }; }
public ClienteService(ClienteCommandHandler commandHandlers, IClienteMongoDbRepository readModelRepository) { this._commandHandlers = commandHandlers; this._readModelRepository = readModelRepository; }