Esempio n. 1
0
        public void GivenTwoParcelsOf1CMDimension_WhenCreateDelivery_ThenCorrectTotalIsReturned()
        {
            var expectedTotalCost = 6m;
            var parcel1           = _parcelService.CreateParcel(1, 1, 1, 1);
            var parcel2           = _parcelService.CreateParcel(1, 1, 1, 1);
            var parcels           = new List <Parcel> {
                parcel1, parcel2
            };
            var delivery = _deliveryService.CreateDelivery(parcels);

            delivery.TotalDeliveryCost.ShouldBe(expectedTotalCost);
            _testOutputHelper.WriteLine(ReturnDeliveryOutput(delivery));
        }
        public void GivenTwoParcelsOf1CMDimension_WhenSetParcelCost_ThenCorrectTotalIsReturned()
        {
            var expectedTotalCost = 6m;
            var parcel1           = _parcelService.CreateParcel(1, 1, 1, 1);
            var parcel2           = _parcelService.CreateParcel(1, 1, 1, 1);
            var parcels           = new List <Parcel> {
                parcel1, parcel2
            };
            var delivery = new Delivery {
                Parcels = parcels, AddSpeedyShipping = false
            };

            delivery.SetParcelCost();
            delivery.ParcelCost.ShouldBe(expectedTotalCost);
            _testOutputHelper.WriteLine(ReturnDeliveryOutput(delivery));
        }