Exemplo n.º 1
0
        public void InformacoesDiariaFundoTest()
        {
            IList <InformacaoDiariaFundo> informacoesFundo = new List <InformacaoDiariaFundo>();
            var retornoDTO    = new RetornoDTO <FundoDTO>();
            var fundoDTO      = new FundoDTO();
            var cadastroFundo = new CadastroFundo();
            var filtro        = new FiltroInformacaoFundoDTO {
                CnpjFundo = "00.017.024/0001-53"
            };

            _integracaoCVM.Setup(x => x.ObterInformacoesFundo(filtro.CnpjFundo)).Returns(informacoesFundo);

            _fundosMapper.Setup(x => x.ListaInformacaoDiariaFundo_TO_ListaInformacaoDiariaFundoDTO(It.IsAny <List <InformacaoDiariaFundo> >())).Returns(new List <InformacaoDiariaFundoDTO>()
            {
                new InformacaoDiariaFundoDTO()
                {
                    CnpjFundo = ""
                }
            });


            FundosService fundosService = new FundosService(_integracaoCVM.Object,
                                                            _fundosMapper.Object);

            var res = fundosService.ObterInformacoesDiariaFundo(filtro);

            Assert.IsNotNull(res.Retorno);
            Assert.IsTrue(res.Sucesso);
        }
Exemplo n.º 2
0
 public IHttpActionResult ObterInformacoesDiariaFundo(FiltroInformacaoFundoDTO filtro)
 {
     try
     {
         return(Ok(_fundosService.ObterInformacoesDiariaFundo(filtro)));
     }
     catch (Exception ex)
     {
         log.Error("Erro ObterInformacoesDiariaFundo: " + ex);
         throw ex;
     }
 }
Exemplo n.º 3
0
 public IList <InformacaoFundo> ListarInformacoesFundo(FiltroInformacaoFundoDTO filtro)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 4
0
        public RetornoDTO <IList <InformacaoDiariaFundoDTO> > ObterInformacoesDiariaFundo(FiltroInformacaoFundoDTO filtro)
        {
            IList <InformacaoDiariaFundoDTO> informacoesDiariaFundoDTO = new List <InformacaoDiariaFundoDTO>();
            var retornoDTO = new RetornoDTO <IList <InformacaoDiariaFundoDTO> >();

            informacoesDiariaFundoDTO = _fundosMapper.ListaInformacaoDiariaFundo_TO_ListaInformacaoDiariaFundoDTO(
                _integracaoCVM.ObterInformacoesFundo(filtro.CnpjFundo).ToList <InformacaoDiariaFundo>()
                );

            retornoDTO.Sucesso = true;
            retornoDTO.Retorno = informacoesDiariaFundoDTO;

            return(retornoDTO);
        }