public void GetValorAbastecidosPorAno_Usuario1_RetornaDados() { DateTime inicio = new DateTime(2020, 1, 1); DateTime fim = new DateTime(2020, 12, 1); int usuarioId = 1; var expected = mocks.GetMocksValoresAbastecimentoMensal(inicio, fim, usuarioId).ToList(); var actual = relatorioService.GetValorAbastecidoPorAno(inicio, fim, usuarioId).ToList(); Assert.That(actual, Is.EqualTo(expected)); }
public async Task <ActionResult <List <ValorAbastecimentoMensalDto> > > GetValorAbastecidosPorAno([FromHeader] DateTime dataInicial, [FromHeader] DateTime dataFinal) { try { var valorAbastecidosPorAnoDto = await relatorioService.GetValorAbastecidoPorAno(dataInicial, dataFinal, GetIdUsuarioLogado()).ToListAsync(); return(Ok(valorAbastecidosPorAnoDto)); } catch (Exception ex) { return(BadRequest(new ErrorResponse(ex.Message))); } }