Skip to content

Instantly share code, notes, and snippets.

@dsibinski
Last active November 10, 2020 20:41
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 dsibinski/f8fea58079d68dd8ac0d194a33964e1b to your computer and use it in GitHub Desktop.
Save dsibinski/f8fea58079d68dd8ac0d194a33964e1b to your computer and use it in GitHub Desktop.
[Test]
public void ApplyBlackFridayDiscount_Should_ApplyBlackFridayDiscount_When_CalledOnNewProduct()
{
// given
var product = CreateProduct(basePrice: 100);
// when
product.ApplyBlackFridayDiscount();
// then
product.Discount.Should().NotBeNull();
product.Discount.Name.Should().Be("Black Friday");
product.Discount.PercentageValue.Should().Be(20);
product.BasePrice.Should().NotBe(product.SalesPrice);
product.SalesPrice.Should().Be(80);
product.IsAvailable.Should().Be(true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment