Last active
February 20, 2018 20:22
-
-
Save avegaraju/a1f282e250027c5acfb1cc7171068c12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Property(Arbitrary = new[] | |
{ | |
typeof (Generator) | |
})] | |
public void DiscountIsApplied_UponCheckout(decimal discount, | |
decimal price) | |
{ | |
var productRequest = new ProductRequest() | |
{ | |
Discount = discount, | |
Price = price, | |
ProductId = (ProductId)1, | |
Quantity = 2 | |
}; | |
var orderRequest = CreateDefaultOrderRequest(productRequest); | |
var order = Order.OrderFactory.CreateFrom(Guid.NewGuid(), orderRequest); | |
var amountToPay = order.Checkout(); | |
var expectedAmountToPay = CalculateAmountToPay(order); | |
amountToPay.Should().Be(expectedAmountToPay); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment