Exemple #1
0
 public IActionResult Post([FromBody] LancamentoViewModel model)
 {
     try
     {
         return(Ok(app.Add(model)));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Exemple #2
0
        public void Insert()
        {
            var lancamentoViewModel = new LancamentoViewModel
            {
                Ativo              = true,
                Valor              = 4,
                DataInclusao       = System.DateTime.Now.ToString("yyyMMdd"),
                ContaDestino       = "1234567",
                ContaOrigem        = "7654321",
                UsuarioAlteracaoId = 1,
                UsuarioInclusaoId  = 1
            };

            var requestResult = app.Add(lancamentoViewModel);

            Assert.True(requestResult.Mensagens.Any(), (requestResult.Mensagens.Any() ? requestResult.Mensagens[0] : "Sucesso"));
        }