public void ExcuteAllRules() { ProductOrderDeatils ProdOrder = new ProductOrderDeatils(); ProdOrder.OrderNumber = 1; ProdOrder.PaymentDesc = "Learning To Ski"; ProdOrder.PaymentType = PaymentDetail.PaymentTypes.VideoPayment.ToString(); ProdOrder.TotalOrderCost = 100; ProdOrder.AgentComm = 0; ProdOrder.AgentCommPer = 5; PaymnetTypeRule PaymentRule = new PaymnetTypeRule(); PaymentRule.RuleExcute(ProdOrder); Assert.AreEqual(true, ProdOrder.ValidationFlag, "Test is failed"); }
public List <string> ValidateRules(List <string> PaymentType) { List <string> results = new List <string>(); CreateProdOrderDeatils(ProdOrder); foreach (string p in PaymentType) { PaymentRule.RuleExcute(ProdOrder); results.Add("Rule Result for Payment Type:" + p + "is" + ProdOrder.ValidationFlag.ToString() + "/n Return Message from Rule:" + ProdOrder.ValidationError.ToString()); } // Return the result messages. return(results); }