public void Generates_Packing_Slip() { var packingSlipGenerator = new MockPackingSlipGenerator(); Payment payment = new Payment(); payment.ProductBeingPurchased = new Product(); payment.ProductBeingPurchased.IsPhysical = true; OrderProcessor processor = new OrderProcessor(packingSlipGenerator); PaymentResult result = processor.Process(payment); Assert.IsTrue(result.GeneratePackingSlip); }
public void should_activate_membership() { var payment = new Payment() { ProductBeingPurchased = new Membership() }; var processor = new OrderProcessor(); var result = processor.Process(payment); Assert.IsTrue(((Membership)payment.ProductBeingPurchased).IsActivated); }
public void should_upgrade_membership() { var payment = new Payment() { ProductBeingPurchased = new UpgradeMembership() }; var processor = new OrderProcessor(); var result = processor.Process(payment); Assert.IsTrue(((UpgradeMembership)payment.ProductBeingPurchased).IsUpgraded); }
public void Creates_A_Duplicate_PackingSlip_For_The_RoyaltyDepartment() { var packingSlipGenerator = new MockPackingSlipGenerator(); var payment = new Payment() { ProductBeingPurchased = new Book() }; var processor = new OrderProcessor(packingSlipGenerator); var result = processor.Process(payment); Assert.AreEqual(2, packingSlipGenerator.PackingSlipCount); }