示例#1
0
        public ProductApplicationMediatorServiceTests()
        {
            _selectiveInvoiceDiscountHandler    = new Mock <IProductApplicationHandler>();
            _confidentialInvoiceDiscountHandler = new Mock <IProductApplicationHandler>();
            _businessLoansHandler = new Mock <IProductApplicationHandler>();

            _selectiveInvoiceDiscountHandler.Setup(m => m.CanHandle(It.IsAny <SelectiveInvoiceDiscount>())).Returns(true);
            _confidentialInvoiceDiscountHandler.Setup(m => m.CanHandle(It.IsAny <ConfidentialInvoiceDiscount>())).Returns(true);
            _businessLoansHandler.Setup(m => m.CanHandle(It.IsAny <BusinessLoans>())).Returns(true);

            _sellerApplication = new Mock <ISellerApplication>();
            _sellerApplication.SetupProperty(p => p.CompanyData, new SellerCompanyData());

            _sut = new ProductApplicationMediatorService(new List <IProductApplicationHandler> {
                _selectiveInvoiceDiscountHandler.Object, _confidentialInvoiceDiscountHandler.Object, _businessLoansHandler.Object
            });
        }
 public ProductApplicationService(IProductApplicationMediatorService productApplicationMediatorService)
 {
     _productApplicationMediatorService = productApplicationMediatorService ?? throw new ArgumentNullException(nameof(productApplicationMediatorService));
 }