// ToDo: move to .ctor //Injected<ICatalogSystem> _cat; // just to demo //Injected<ReferenceConverter> _refConv; //Injected<PricingLoader> _priceLoader; public VariationController( IContentLoader contentLoader , UrlResolver urlResolver , AssetUrlResolver assetUrlResolver , ThumbnailUrlResolver thumbnailUrlResolver // use this in node listing instead , IPriceService priceService , IPriceDetailService pricedetailService , ICurrentMarket currentMarket , IPromotionEngine promotionEngine , IOrderRepository orderRepository , IOrderGroupFactory orderGroupFactory , ILineItemCalculator lineItemCalculator , ILineItemValidator lineItemValidator , IPlacedPriceProcessor placedPriceProcessor , ICurrentMarket currentMarketService , IInventoryService inventoryService , IWarehouseRepository warehouseRepository , MyPriceCalculator myPriceCalculator ) : base(contentLoader, urlResolver, assetUrlResolver, thumbnailUrlResolver, currentMarket) { _priceService = priceService; _priceDetailService = pricedetailService; //_currentMarket2 = currentMarket; _promotionEngine = promotionEngine; _orderRepository = orderRepository; _orderGroupFactory = orderGroupFactory; _lineItemCalculator = lineItemCalculator; _lineItemValidator = lineItemValidator; _placedPriceProcessor = placedPriceProcessor; _currentMarketService = currentMarketService; _inventoryService = inventoryService; _warehouseRepository = warehouseRepository; _myPriceCalculator = myPriceCalculator; }
public CustomPromotionEngineContentLoader( MyPriceCalculator myPriceCalculator, IContentLoader contentLoader, CampaignInfoExtractor campaignInfoExtractor, ReadOnlyPricingLoader readOnlyPricingLoader) : base(contentLoader, campaignInfoExtractor, readOnlyPricingLoader) { _myPriceCalculator = myPriceCalculator; _contentLoader = contentLoader; }
public void TestMethod1() { MyPriceCalculator case1 = new MyPriceCalculator(1, 500, "DIS10"); case1.checkPromotionRules(); Assert.AreEqual(case1.getPromotedPrice(), 450); MyPriceCalculator case2 = new MyPriceCalculator(1, 2000, "STARCARD"); case2.checkPromotionRules(); Assert.AreEqual(case2.getPromotedPrice(), 1800); MyPriceCalculator case3 = new MyPriceCalculator(2, 1500, "DIS10"); case3.checkPromotionRules(); Assert.AreEqual(case3.getPromotedPrice(), 2250); MyPriceCalculator case4 = new MyPriceCalculator(4, 500, "STARCARD"); case4.checkPromotionRules(); Assert.AreEqual(case4.getPromotedPrice(), 1500); MyPriceCalculator case5 = new MyPriceCalculator(2, 1500, "STARCARD"); case5.checkPromotionRules(); Assert.AreEqual(case5.getPromotedPrice(), 2100); MyPriceCalculator case6 = new MyPriceCalculator(4, 3000, "STARCARD"); case6.checkPromotionRules(); Assert.AreEqual(case6.getPromotedPrice(), 9000); MyPriceCalculator case7 = new MyPriceCalculator(4, 3000, "NONE"); case7.checkPromotionRules(); Assert.AreEqual(case7.getPromotedPrice(), 9000); MyPriceCalculator case8 = new MyPriceCalculator(4, 3000, "FFDSAFDS"); case8.checkPromotionRules(); Assert.AreEqual(case8.getPromotedPrice(), 9000); MyPriceCalculator case9 = new MyPriceCalculator(4, 3000, "FFDSAFDS"); case9.checkPromotionRules(); Assert.AreEqual(case9.getPromotedPrice(), 9000); MyPriceCalculator case10 = new MyPriceCalculator(4, 500, "STARCARD1"); case10.checkPromotionRules(); Assert.AreEqual(case10.getPromotedPrice(), 1200); }