public void Test_NoRulesHit_Video_Online() { var orderItem = new OrderItem() { Key = "Lord Of Rings", ProductType = ProductTypeEnum.Video, DeliveryType = DeliveryTypeEnum.Online }; var log = new EventLogTrace(); ruleEngine.Process(orderItem, log.HandleRuleHit); Assert.Empty(log.Details); }
public void Test_Video_LearningToSki_Online() { var orderItem = new OrderItem() { Key = "Learning To Ski", ProductType = ProductTypeEnum.Video, DeliveryType = DeliveryTypeEnum.Online }; var log = new EventLogTrace(); ruleEngine.Process(orderItem, log.HandleRuleHit); Assert.True(log.Details.ContainsValue("Video_LearningToSki_AddFirstAid")); Assert.Single(log.Details); }
public void Test_Online_Music() { //Physical Product //Product is book var orderItem = new OrderItem() { ProductType = ProductTypeEnum.Music, DeliveryType = DeliveryTypeEnum.Online }; var log = new EventLogTrace(); ruleEngine.Process(orderItem, log.HandleRuleHit); Assert.True(log.Details.ContainsValue("Music_Pay_Royalty")); Assert.Single(log.Details); }
public void Test_Physical_NonBook() { //Physical Product var orderItem = new OrderItem() { ProductType = ProductTypeEnum.Furniture, DeliveryType = DeliveryTypeEnum.Physical }; var log = new EventLogTrace(); ruleEngine.Process(orderItem, log.HandleRuleHit); Assert.True(log.Details.ContainsValue("Physical_Item_Generate_Pack_Slip")); Assert.True(log.Details.ContainsValue("Physical_Or_Book_AgentCommission")); Assert.Equal(2, log.Details.Count); }
public void Test_Physical_Book() { //Physical Product //Product is book var orderItem = new OrderItem() { ProductType = ProductTypeEnum.Book, DeliveryType = DeliveryTypeEnum.Physical }; var log = new EventLogTrace(); ruleEngine.Process(orderItem, log.HandleRuleHit); Assert.True(log.Details.ContainsValue("Physical_Item_Generate_Pack_Slip")); Assert.True(log.Details.ContainsValue("Physical_Or_Book_AgentCommission")); Assert.True(log.Details.ContainsValue("Book_DuplicatePackSlip_Royalty")); Assert.Equal(3, log.Details.Count); }
public void Test_Membership_Upgrade() { var orderItem = new OrderItem() { Key = "Learning To Ski", ProductType = ProductTypeEnum.UpgradeMembership, DeliveryType = DeliveryTypeEnum.Online }; var log = new EventLogTrace(); ruleEngine.Process(orderItem, log.HandleRuleHit); Assert.True(log.Details.ContainsValue("Membership_Upgrade")); Assert.True(log.Details.ContainsValue("Membership_Communication")); Assert.True(log.Details.Where(x => x.Value == "Membership_Communication").FirstOrDefault().Key > log.Details.Where(x => x.Value == "Membership_Upgrade").FirstOrDefault().Key); Assert.Equal(2, log.Details.Count); }
public void Test_Video_LearningToSki_Physical() { var orderItem = new OrderItem() { Key = "Learning To Ski", ProductType = ProductTypeEnum.Video, DeliveryType = DeliveryTypeEnum.Physical }; var log = new EventLogTrace(); ruleEngine.Process(orderItem, log.HandleRuleHit); Assert.True(log.Details.ContainsValue("Video_LearningToSki_AddFirstAid")); Assert.True(log.Details.ContainsValue("Physical_Item_Generate_Pack_Slip")); Assert.True(log.Details.ContainsValue("Physical_Or_Book_AgentCommission")); Assert.True(log.Details.Where(x => x.Value == "Physical_Item_Generate_Pack_Slip").FirstOrDefault().Key > log.Details.Where(x => x.Value == "Video_LearningToSki_AddFirstAid").FirstOrDefault().Key); Assert.Equal(3, log.Details.Count); }