Skip to content

Instantly share code, notes, and snippets.

@avegaraju
Last active February 20, 2018 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avegaraju/a1f282e250027c5acfb1cc7171068c12 to your computer and use it in GitHub Desktop.
Save avegaraju/a1f282e250027c5acfb1cc7171068c12 to your computer and use it in GitHub Desktop.
[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