public void RulesTests_DebitCardAccountRule_PassesFor_GoldBundle() { var bundle = new GoldBundle().GetDefault; var rule = new DebitCardAccountRule(); var result = rule.Execute(bundle); Assert.IsTrue(result); }
public void RulesTests_DebitCardAccountRule_HandlesNoAccount() { var bundle = new GoldBundle().GetDefault; bundle.Products = new List <Product>(); var rule = new DebitCardAccountRule(); var result = rule.Execute(bundle); Assert.IsFalse(result); }
public void RulesTests_DebitCardAccountRule_PassesFor_GoldBundleWithPensionerAccount() { var bundle = new GoldBundle().GetDefault; bundle.Products = new List <Product> { new PensionerAccount() }; var rule = new DebitCardAccountRule(); var result = rule.Execute(bundle); Assert.IsTrue(result); }
public void ProductBundleService_GetsAnswersFor_GoldBundle() { var bundle = new GoldBundle(); var answers = _productBundleService.GetRulesConditions(bundle); var expectedAnswers = new[] { "Age > 17", "Income > 40000" }; Assert.IsTrue(answers.Length == expectedAnswers.Length); Assert.IsTrue(answers.All(expectedAnswers.Contains)); }