public void GetLitrosAbastecidosPorAno_Usuario1_RetornaDados()
        {
            DateTime inicio    = new DateTime(2020, 1, 1);
            DateTime fim       = new DateTime(2020, 12, 1);
            int      usuarioId = 1;

            var expected = mocks.GetMocksLitrosAbastecimentoMensalDto(inicio, fim, usuarioId).ToList();
            var actual   = relatorioService.GetLitrosAbastecidosPorAno(inicio, fim, usuarioId).ToList();

            Assert.That(actual, Is.EqualTo(expected));
        }
Пример #2
0
        public async Task <ActionResult <List <LitrosAbastecimentoMensalDto> > > GetLitrosAbastecidosPorAno([FromHeader] DateTime dataInicial, [FromHeader] DateTime dataFinal)
        {
            try
            {
                var litrosAbastecidosPorAnoDto = await relatorioService.GetLitrosAbastecidosPorAno(dataInicial, dataFinal, GetIdUsuarioLogado()).ToListAsync();

                return(Ok(litrosAbastecidosPorAnoDto));
            }
            catch (Exception ex)
            {
                return(BadRequest(new ErrorResponse(ex.Message)));
            }
        }