Пример #1
0
        public void CalculateParcleBySizeTestForXLParcel()
        {
            //Arrange
            var parcel = new Parcel()
            {
                Height = 300,
                Length = 50,
                Width  = 60
            };


            //Act
            var costCalculation = new DeliveryCosts();
            var targetParcel    = costCalculation.CalculateDeliveryCostByParcelSize(parcel);

            //Assert
            Assert.AreEqual(25, targetParcel.Cost);
        }
        public DeliveryCosts GetDeliveryServiceCost()
        {
            var deliveryCost = new DeliveryCosts();

            // motorbike
            DeliveryFactory factory = new MotorbikeDeliveryFactory();

            deliveryCost.Motorbike = factory.GetDelivery().GetDeliveryCost();

            // train
            factory            = new TrainDeliveryFactory();
            deliveryCost.Train = factory.GetDelivery().GetDeliveryCost();

            // aircraft
            factory = new AircraftDeliveryFactory();
            deliveryCost.Aircraft = factory.GetDelivery().GetDeliveryCost();

            return(deliveryCost);
        }