Exemple #1
0
        public async Task DadoUmRegistroDeUmaContaAPagarInvalidaORetornoDeveSerQueFoiNaoRegistrada()
        {
            _payableAccountCreateInvalidCommand = new PayableAccountCreateCommand();
            var retorno = (CommandResult)await _payableAccountHandler.Handle(_payableAccountCreateInvalidCommand);

            Assert.True(!retorno.Sucess && ((IList <Notification>)retorno.Notification).Count == 4);
        }
Exemple #2
0
 public PayableAccountCreateCommandTests()
 {
     _payableAccountCreateValidCommand = new PayableAccountCreateCommand(
         name: "Conta de teste",
         value: 10.99m,
         dueDate: DateTime.Now.Date.AddDays(4),
         payDay: DateTime.Now.Date);
     _payableAccountCreateInvalidCommand = new PayableAccountCreateCommand();
 }
Exemple #3
0
        public async Task DadoUmRegistroDeUmaContaAPagarEOPagamentoDestaContaEmAtrasoORetornoDeveSerQueFoiRegistradaEPaga()
        {
            _payableAccountCreateValidCommand = new PayableAccountCreateCommand(
                name: "Conta de teste",
                value: 100m,
                dueDate: DateTime.Now.Date,
                payDay: DateTime.Now.Date.AddDays(4));
            var retorno = (CommandResult)await _payableAccountHandler.Handle(_payableAccountCreateValidCommand);

            Assert.True(retorno.Sucess);
        }
Exemple #4
0
 public async Task <CommandResult> Post(
     [FromBody] PayableAccountCreateCommand command,
     [FromServices] IMediator mediator)
 {
     return((CommandResult)await mediator.Send(command));
 }