//Price More than 100, and at least 5 products from category
        public async Task CheckAndConditionalDiscount()
        {
            Assert.AreEqual(1000, store.CalcPaySum(shoppingBasket));
            Guid discount1 = await marketRules.CreateConditionalDiscountAsync(store, store.GetFounder().Username, store.GetId(), RuleContext.Store, RuleType.Price, 0.2, valueGreaterEQThan : 100);

            Guid discount2 = await marketRules.CreateConditionalDiscountAsync(store, store.GetFounder().Username, store.GetId(), RuleContext.Category, RuleType.Quantity, 0.2, category : "CategoryName", valueGreaterEQThan : 5);

            await marketRules.GenerateConditionalDiscountsAsync(store, store.GetFounder().Username, DiscountRuleRelation.And, store.GetId(), discount1, discount2, false);

            store.RemoveDiscount(store.GetFounder().Username, discount2);
            Assert.AreEqual(800, store.CalcPaySum(shoppingBasket));
        }
        public async Task <Guid> AddDiscountRuleAsync(string username, DiscountRuleRelation discountRuleRelation, Guid storeId, Guid discountId1, Guid discountId2, bool decide = false)
        {
            Guid discountId = await marketRules.GenerateConditionalDiscountsAsync(await MarketStores.Instance.GetStoreById(storeId), username, discountRuleRelation, storeId, discountId1, discountId2, decide);

            await StorePredicatesManager.Instance.SaveRequest(++counter, "GenerateConditionalDiscountsAsync", username, discountRuleRelation, storeId, discountId1, discountId2, decide, discountId);

            var discountRelation = new DiscountsRelation(username, discountId, discountRuleRelation, storeId, discountId1, discountId2, decide);
            await discountsManager.AddRelation(discountRelation);

            return(discountId);
        }