Example #1
0
 public ConfidentialInvoiceWebServiceWrapper(IConfidentialInvoiceService confidentialInvoiceWebService, decimal totalLedgerNetworth, decimal advancePercentage, decimal vatRate)
 {
     _confidentialInvoiceWebService = confidentialInvoiceWebService;
     _totalLedgerNetworth           = totalLedgerNetworth;
     _advancePercentage             = advancePercentage;
     _vatRate = vatRate;
 }
 public ProductApplicationService(ISelectInvoiceService selectInvoiceService,
                                  IConfidentialInvoiceService confidentialInvoiceWebService,
                                  IBusinessLoansService businessLoansService)
 {
     _dispatcher = new ApplicationDispatcher(selectInvoiceService, confidentialInvoiceWebService,
                                             businessLoansService);
 }
        public void Init()
        {
            _selectInvoiceService       = A.Fake <ISelectInvoiceService>();
            _confidentialInvoiceService = A.Fake <IConfidentialInvoiceService>();
            _businessLoansService       = A.Fake <IBusinessLoansService>();

            _productApplicationService = new ProductApplicationService(
                _selectInvoiceService,
                _confidentialInvoiceService,
                _businessLoansService);

            A.CallTo(() => _selectInvoiceService.SubmitApplicationFor(
                         A <string> ._,
                         A <decimal> ._,
                         A <decimal> ._)).Returns(codeOfSuccessfulAnswerFromService);

            A.CallTo(
                () => _confidentialInvoiceService.SubmitApplicationFor(
                    A <CompanyDataRequest> ._,
                    A <decimal> ._,
                    A <decimal> ._,
                    A <decimal> ._)).Returns(CreateSuccessApplicationResult());

            A.CallTo(
                () => _businessLoansService.SubmitApplicationFor(
                    A <CompanyDataRequest> ._,
                    A <LoansRequest> ._))
            .Returns(CreateSuccessApplicationResult());
        }
Example #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="selectInvoiceService"></param>
        /// <param name="confidentialInvoiceWebService"></param>
        /// <param name="businessLoansService"></param>
        public ProductApplicationService(ISelectInvoiceService selectInvoiceService, IConfidentialInvoiceService confidentialInvoiceWebService, IBusinessLoansService businessLoansService)
        {
            ServicesMediator = new ServicesMediator();

            ServicesMediator.Add(typeof(ISelectInvoiceService), selectInvoiceService);
            ServicesMediator.Add(typeof(IConfidentialInvoiceService), confidentialInvoiceWebService);
            ServicesMediator.Add(typeof(IBusinessLoansService), businessLoansService);
        }
Example #5
0
 public ProductApplicationService(
     ISelectInvoiceService selectInvoiceService,
     IConfidentialInvoiceService confidentialInvoiceWebService,
     IBusinessLoansService businessLoansService)
 {
     // should be passed with DI directly inside processors
     locator = new ProcessorServiceLocator(selectInvoiceService, confidentialInvoiceWebService, businessLoansService);
 }
 public ProductApplicationService(ISelectInvoiceService selectInvoiceService,
                                  IConfidentialInvoiceService confidentialInvoiceWebService,
                                  IBusinessLoansService businessLoansService)
 {
     _selectInvoiceService          = selectInvoiceService;
     _confidentialInvoiceWebService = confidentialInvoiceWebService;
     _businessLoansService          = businessLoansService;
 }
 public ProductApplicationServiceTests()
 {
     _fixture = new Fixture();
     sid      = Substitute.For <ISelectInvoiceService>();
     cid      = Substitute.For <IConfidentialInvoiceService>();
     loans    = Substitute.For <IBusinessLoansService>();
     _service = new ProductApplicationService(sid, cid, loans);
 }
 // should be assinged directly inside proccessors via DI
 public ProcessorServiceLocator(
     ISelectInvoiceService selectInvoiceService,
     IConfidentialInvoiceService confidentialInvoiceWebService,
     IBusinessLoansService businessLoansService)
 {
     this.selectInvoiceService          = selectInvoiceService;
     this.confidentialInvoiceWebService = confidentialInvoiceWebService;
     this.businessLoansService          = businessLoansService;
 }
 public ProductHandlerLocator(ISelectInvoiceService selectInvoiceService, IConfidentialInvoiceService confidentialInvoiceWebService, IBusinessLoansService businessLoansService)
 {
     _services = new Dictionary <Type, IProductHandler <IProduct, int> >
     {
         { typeof(BusinessLoans), new BusinessLoansHandler(businessLoansService) },
         { typeof(ConfidentialInvoiceDiscount), new ConfidentialInvoiceDiscountHandler(confidentialInvoiceWebService) },
         { typeof(SelectiveInvoiceDiscount), new SelectiveInvoiceDiscountHandler(selectInvoiceService) }
     };
 }
Example #10
0
        public ProductApplicationService(ISelectInvoiceService selectInvoiceService, IConfidentialInvoiceService confidentialInvoiceWebService, IBusinessLoansService businessLoansService)
        {
            _selectInvoiceService          = selectInvoiceService;
            _confidentialInvoiceWebService = confidentialInvoiceWebService;
            _businessLoansService          = businessLoansService;

            _applicationResultMapper = new ApplicationResultMapper();
            _sellerApplicationMapper = new SellerApplicationMapper();
            _businessLoanMapper      = new BusinessLoanMapper();
        }
Example #11
0
 public ProductApplicationService CreateProductApplicationService(IBusinessLoansService businessLoansService,
                                                                  IConfidentialInvoiceService confidentialInvoiceService,
                                                                  ISelectInvoiceService selectInvoiceService)
 {
     return(new ProductApplicationService(new ISellerApplicationHandler[]
     {
         new BuisnessLoansHandler(businessLoansService),
         new ConfidentialInvoiceServiceHandler(confidentialInvoiceService),
         new SelectiveInvoiceDiscountHandler(selectInvoiceService),
     }));
 }
Example #12
0
 public ApplicationDispatcher(ISelectInvoiceService selectInvoiceService,
                              IConfidentialInvoiceService confidentialInvoiceWebService,
                              IBusinessLoansService businessLoansService)
 {
     _submitters = new List <IApplicationSubmitter>
     {
         new BusinessLoansSubmitter(businessLoansService),
         new ConfidentialInvoiceDiscountSubmitter(confidentialInvoiceWebService),
         new SelectiveInvoiceDiscountSubmitter(selectInvoiceService)
     };
 }
Example #13
0
        public ProductApplicationService(ISelectInvoiceService selectInvoiceService, IConfidentialInvoiceService confidentialInvoiceWebService, IBusinessLoansService businessLoansService)
        {
            _selectInvoiceService = selectInvoiceService
                                    ?? throw new ArgumentNullException(nameof(selectInvoiceService));

            _confidentialInvoiceWebService = confidentialInvoiceWebService
                                             ?? throw new ArgumentNullException(nameof(confidentialInvoiceWebService));

            _businessLoansService = businessLoansService
                                    ?? throw new ArgumentNullException(nameof(businessLoansService));
        }
Example #14
0
        public ProductHandlerStore(ISelectInvoiceService selectInvoiceService,
                                   IConfidentialInvoiceService confidentialInvoiceWebService, IBusinessLoansService businessLoansService)
        {
            _selectInvoiceService          = selectInvoiceService;
            _confidentialInvoiceWebService = confidentialInvoiceWebService;
            _businessLoansService          = businessLoansService;

            ProductHandlers = new List <IProductHandler>
            {
                new SelectiveInvoiceDiscountHandler(_selectInvoiceService),
                new ConfidentialInvoiceDiscountHandler(_confidentialInvoiceWebService),
                new BusinessLoansHandler(_businessLoansService)
            };
        }
Example #15
0
 public ConfidentialInvoiceDiscountSubmitter(IConfidentialInvoiceService confidentialInvoiceWebService) =>
 public ConfidentialInvoiceDiscountService(IConfidentialInvoiceService confidentialInvoiceService)
 {
     this.confidentialInvoiceService = confidentialInvoiceService ?? throw new ArgumentNullException(nameof(confidentialInvoiceService));
 }
 public ConfidentialInvoiceServiceClient(IConfidentialInvoiceService confidentialInvoiceService, ICompanyDataMapper companyDataMapper)
 {
     _confidentialInvoiceService = confidentialInvoiceService;
     _companyDataMapper          = companyDataMapper;
 }
 public ConfidentialInvoiceDiscountHandler(IConfidentialInvoiceService confidentialInvoiceService)
 {
     _confidentialInvoiceWebService = confidentialInvoiceService;
 }
Example #19
0
 public ConfidentialInvoiceDiscountServiceHandler()
 {
     service = StartUp.Scope.Resolve <IConfidentialInvoiceService>();
 }
Example #20
0
 public ConfidentialInvoiceStrategy(IConfidentialInvoiceService confidentialInvoiceWebService)
 {
     _confidentialInvoiceWebService = confidentialInvoiceWebService;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="confidentialInvoiceService"></param>
 /// <param name="confidentialInvoiceDiscountProduct"></param>
 public ConfidentialInvoiceDiscountService(IConfidentialInvoiceService confidentialInvoiceService, IConfidentialInvoiceDiscountProduct confidentialInvoiceDiscountProduct)
 {
     _confidentialInvoiceService         = confidentialInvoiceService;
     _confidentialInvoiceDiscountProduct = confidentialInvoiceDiscountProduct;
 }
 public ConfidentialInvoiceDiscountHandler(IConfidentialInvoiceService confidentialInvoiceWebService)
 {
     _confidentialInvoiceWebService = confidentialInvoiceWebService ?? throw new ArgumentNullException(nameof(confidentialInvoiceWebService));
 }
Example #23
0
 public SubmitApplicationStrategyFactory(ISelectInvoiceService selectInvoiceService, IConfidentialInvoiceService confidentialInvoiceWebService, IBusinessLoansService businessLoansService)
 {
     _selectInvoiceService          = selectInvoiceService;
     _confidentialInvoiceWebService = confidentialInvoiceWebService;
     _businessLoansService          = businessLoansService;
 }
 public ConfidentialInvoiceServiceWorker(IServiceProvider serviceProvider)
 {
     _confidentialInvoiceService = (IConfidentialInvoiceService)serviceProvider.GetService(typeof(IConfidentialInvoiceService));
 }
 public ConfidentialInvoiceDiscountProcessor(ISellerApplication application, IConfidentialInvoiceService service)
 {
     this.application = application;
     this.service     = service;
 }
 public ConfidentialInvoiceApplicationHandler(IConfidentialInvoiceService confidentialInvoiceService)
 {
     _confidentialInvoiceService = confidentialInvoiceService;
 }