public FundoControllerTest()
        {
            fundoRepository = new FundoRepository(Context);
            unitOfWork      = new UnitOfWork(Context);
            mapper          = AutoMapperConfig.RegisterMappings().CreateMapper();
            fundoService    = new FundoService(fundoRepository, unitOfWork, mapper);
            fundoController = new FundoController(fundoService);

            CarregarFundos();
        }
예제 #2
0
        public async void ListarFundos_DeveTrazerTodosOsFundosDoMock()
        {
            FundoController controller = CriarMockFundoController();

            var result = await controller.Get();

            var viewResult = Assert.IsType <OkObjectResult>(result);
            var model      = Assert.IsAssignableFrom <List <Fundo> >(viewResult.Value);

            Assert.Equal(2, model.Count());
        }