public BankDomainService( IBankValidation bankValidation, IBankBinRepository bankBinRepository) { this.bankValidation = bankValidation; this.bankBinRepository = bankBinRepository; }
public PaymentServiceTest() { this.logger = new Mock <ILogger>(); this.jsonSerializer = new Mock <IJsonSerializer>(); this.xmlSerializer = new Mock <IXmlSerializer>(); this.bankBinQuery = new BankDomainService(bankValidation, bankBinRepository); IEnumerable <PaymentProvider> paymentProviders = new List <PaymentProvider> { new ESTPaymentIntegration(logger.Object, jsonSerializer.Object, xmlSerializer.Object, bankBinQuery), new IPARAPaymentIntegration(logger.Object, jsonSerializer.Object, xmlSerializer.Object, bankBinQuery), new MPIPaymentIntegration(logger.Object, jsonSerializer.Object, xmlSerializer.Object, bankBinQuery), new PAYTENPaymentIntegration(logger.Object, jsonSerializer.Object, xmlSerializer.Object, bankBinQuery) }; var mapperConfiguration = new MapperConfiguration(cfg => { cfg.CreateMap <DoPaymentRequest, PaymentRequest>(); }); IMapper mapper = mapperConfiguration.CreateMapper(); this.classMapper = new ClassMapper(mapper); this.httpContextAccessor = new Mock <IHttpContextAccessor>(); this.dbContextFactory = new DbContextFactory(); this.unitOfWorkFactory = new UnitOfWorkFactory(httpContextAccessor.Object, dbContextFactory); this.bankBinRepository = new BankBinRepository(unitOfWorkFactory); this.bankProviderRepository = new BankProviderRepository(unitOfWorkFactory); this.providerRepository = new ProviderRepository(unitOfWorkFactory); this.bankValidation = new BankValidation(bankBinRepository, bankProviderRepository); this.bankDomainService = new BankDomainService(bankValidation, bankBinRepository); this.providerValidation = new ProviderValidation(paymentProviders, providerRepository); this.providerDomainService = new ProviderDomainService(providerValidation, providerRepository); this.paymentService = new PaymentService( classMapper, unitOfWorkFactory, bankDomainService, providerDomainService); }