Example #1
0
 public OrderTestContext(PurchaseTestInput purchaseTestInput, OrderTestContextConfigurator orderTestContextConfigurator)
 {
     this.PurchaseTestInput = purchaseTestInput;
     this.IsPromoCodePurchase = orderTestContextConfigurator.FreePurchaseSpecification.
         Or(orderTestContextConfigurator.PromotionalPurchaseSpecification).
         IsSatisfiedBy(purchaseTestInput);
     this.IsCreditCardPurchase =
         orderTestContextConfigurator.CreditCardSpecification.
         And(orderTestContextConfigurator.WiretransferSpecification.Not()).
         And(orderTestContextConfigurator.FreePurchaseSpecification.Not()).
         And(orderTestContextConfigurator.PromotionalPurchaseSpecification.Not()).
         IsSatisfiedBy(purchaseTestInput);
 }
Example #2
0
 public PlaceOrderPage(IWebDriver driver, PurchaseTestInput purchaseTestInput) : base(driver)
 {
     this.purchaseTestInput = purchaseTestInput;
     this.promotionalPurchaseSpecification = new PromotionalPurchaseSpecification(purchaseTestInput);
     this.wiretransferSpecification = new WiretransferSpecification(purchaseTestInput);
     this.creditCardSpecification = new CreditCardSpecification(purchaseTestInput);
     this.freePurchaseSpecification = new FreePurchaseSpecification();
     this.IsPromoCodePurchase = this.freePurchaseSpecification.Or(this.promotionalPurchaseSpecification).IsSatisfiedBy(this.purchaseTestInput);
     this.IsCreditCardPurchase = this.creditCardSpecification.
     And(this.wiretransferSpecification.Not()).
     And(this.freePurchaseSpecification.Not()).
     And(this.promotionalPurchaseSpecification.Not()).
     IsSatisfiedBy(this.purchaseTestInput);
 }