Пример #1
0
        public void WeekendPercentageDiscount_WhenInitialAmountIs_100_And_20PercentDiscountProvided_ThenReturns64()
        {
            // Arrange
            WeekendSale          weekendSale          = new WeekendSale();
            PercentPriceStrategy percentPriceStrategy = new PercentPriceStrategy(20);
            decimal price = 100;

            // Act
            weekendSale.SetStrategy(percentPriceStrategy);
            var result = weekendSale.GetTotal(price);

            // Assert
            result.Should().Be(64);
        }
Пример #2
0
        public void NormalPercentageDiscount_WhenInitialAmountIs_100_And_20PercentDiscountProvided_ThenReturns80()
        {
            // Arrange
            NormalSale           normalSale           = new NormalSale();
            PercentPriceStrategy percentPriceStrategy = new PercentPriceStrategy(20);
            decimal price = 100;

            // Act
            normalSale.SetStrategy(percentPriceStrategy);
            var result = normalSale.GetTotal(100);

            // Assert
            result.Should().Be(80);
        }