Пример #1
0
        public void CalculatePriceDiscount_NonLargeThirdTransfer_DiscountNotApplied
            (Sizes size, Providers provider)
        {
            var date = new DateTime(2000, 1, 1);
            var freeLargeShippping = new FreeLargeShipping(_dataService);
            var price = _dataService.GetPrice(provider, size);

            _dataService.IncrementLargeShipments(date);
            _dataService.IncrementLargeShipments(date);


            var shipment = new Shipment()
            {
                Date     = date,
                Size     = size,
                Price    = price,
                Provider = provider,
            };

            var(discountedPrice, discount) = freeLargeShippping.CalculatePriceDiscount(shipment);

            discountedPrice.Should().HaveValue();
            discountedPrice.Value.Should().Be(price);

            discount.Should().NotHaveValue();
        }
Пример #2
0
        public void CalculatePriceDiscount_NoShipments_DoesNotApplyDiscount
            (Sizes size, Providers provider)
        {
            var freeLargeShippping = new FreeLargeShipping(_dataService);

            var price = _dataService.GetPrice(provider, size);

            var shipment = new Shipment()
            {
                Date     = new DateTime(2000, 1, 1),
                Size     = size,
                Price    = price,
                Provider = provider,
            };

            var(discountedPrice, discount) = freeLargeShippping.CalculatePriceDiscount(shipment);

            discountedPrice.Should().HaveValue();
            discountedPrice.Value.Should().Be(price);

            discount.Should().NotHaveValue();
        }