public HomeControllerTests(DoacaoFixture doacaoFixture, EnderecoFixture enderecoFixture, CartaoCreditoFixture cartaoCreditoFixture) { _doacaoFixture = doacaoFixture; _enderecoFixture = enderecoFixture; _cartaoCreditoFixture = cartaoCreditoFixture; _mapper = new Mock <IMapper>(); _doacaoValida = doacaoFixture.DoacaoValida(); _doacaoValida.AdicionarEnderecoCobranca(enderecoFixture.EnderecoValido()); _doacaoValida.AdicionarFormaPagamento(cartaoCreditoFixture.CartaoCreditoValido()); _doacaoModelValida = doacaoFixture.DoacaoModelValida(); _doacaoModelValida.EnderecoCobranca = enderecoFixture.EnderecoModelValido(); _doacaoModelValida.FormaPagamento = cartaoCreditoFixture.CartaoCreditoModelValido(); _mapper.Setup(a => a.Map <DoacaoViewModel, Doacao>(_doacaoModelValida)).Returns(_doacaoValida); _doacaoService = new DoacaoService(_mapper.Object, _doacaoRepository.Object, _domainNotificationService); DbContextOptions <VaquinhaOnlineDBContext> _options = new DbContextOptionsBuilder <VaquinhaOnlineDBContext>() .UseInMemoryDatabase(databaseName: "VaquinhaOnlineDIOTests") .Options; var _context = new VaquinhaOnlineDBContext(_options); var _homeRepository = new HomeInfoRepository(_context); var _causaRepository = new CausaRepository(_context); _homeInfoService = new HomeInfoService(_mapper.Object, _doacaoService, _globallAppConfig.Object, _homeRepository, _causaRepository); }
public HomeControllerTests() { _doacaoService = new DoacaoService(_mapper.Object, _doacaoRepository.Object, _domainNotificationService); _homeInfoService = new HomeInfoService(_mapper.Object, _doacaoService, _globalSettings.Object, _homeInfoRepository.Object, _causaRepository.Object); _HomeViewModel = ObterDadosParaTeste(); }
public HomeController(ILogger <HomeController> logger, IHomeInfoService homeService, IToastNotification toastNotification) { _logger = logger; _homeService = homeService; _toastNotification = toastNotification; }
public Task <HomeViewModel> ServiceRetornaDadosValidos(IHomeInfoService homeService) { var dadosIniciaisHome = homeService.RecuperarDadosIniciaisHomeAsync(); return(dadosIniciaisHome); }
public HomeController(ILogger <HomeController> logger, IHomeInfoService homeService) { _logger = logger; _homeService = homeService; }