Exemple #1
0
        public void CalculateOrderCostTestWithoutSpeedyShippingTest()
        {
            //Arrange
            List <Parcel> parcels = new List <Parcel>();

            parcels.Add(new Parcel
            {
                Height = 6,
                Length = 7,
                Width  = 9
            });
            parcels.Add(new Parcel
            {
                Height = 10,
                Length = 30,
                Width  = 40
            });


            //Act
            var cost  = new DeliveryCostsCalculation();
            var order = cost.CalculateOrderCost(parcels);

            //Assert
            Assert.AreEqual(11, order.TotalCost);
        }
Exemple #2
0
        public void CalculateOverWeightParcelForSmallSize()
        {
            //Arrange
            List <Parcel> parcels = new List <Parcel>();

            parcels.Add(new Parcel
            {
                Height = 6,
                Length = 7,
                Width  = 9,
                Weight = 11
            });

            //Act
            var cost  = new DeliveryCostsCalculation();
            var order = cost.CalculateOrderCost(parcels, true);

            //Assert
            Assert.AreEqual(23, order.TotalCost);
        }