Guest User

Untitled

a guest
Feb 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. [Property(Arbitrary = new[]
  2. {
  3. typeof (Generator)
  4. })]
  5. public void DiscountIsApplied_UponCheckout(decimal discount,
  6. decimal price)
  7. {
  8. var productRequest = new ProductRequest()
  9. {
  10. Discount = discount,
  11. Price = price,
  12. ProductId = (ProductId)1,
  13. Quantity = 2
  14. };
  15.  
  16. var orderRequest = CreateDefaultOrderRequest(productRequest);
  17.  
  18. var order = Order.OrderFactory.CreateFrom(Guid.NewGuid(), orderRequest);
  19.  
  20. var amountToPay = order.Checkout();
  21.  
  22. var expectedAmountToPay = CalculateAmountToPay(order);
  23.  
  24. amountToPay.Should().Be(expectedAmountToPay);
  25. }
Add Comment
Please, Sign In to add comment