Пример #1
0
        public void SubtractQuantity_Should_DecreaseQuantity(int value)
        {
            var shoppingCartPosition = new ShoppingCartPosition <Book>(_book, 10);

            shoppingCartPosition.SubtractQuantity(value);
            var expected = shoppingCartPosition.Quantity -= value;

            shoppingCartPosition.Quantity.Should().Be(expected);
        }
Пример #2
0
 public void SubtractQuantity_For_Negative_Throw_NegativeQuantity(int value)
 {
     FluentActions.Invoking(() => _shoppingCartPosition.SubtractQuantity(value))
     .Should()
     .Throw <NegativeQuantity>();
 }