Exemplo n.º 1
0
        public void ShoudReturnTheCostOfAHeavyParcel()
        {
            var weight = 51d;

            var testCost = WeightLimit.GetHeavyParcelCost(weight);

            var expectedCost = 50 + (51 - 50) * 1;

            Assert.Equal(expectedCost, testCost);
        }
Exemplo n.º 2
0
        public void ShoudReturn50_WhenParcelIsBelowLimit()
        {
            var weight = 25d;

            var testCost = WeightLimit.GetHeavyParcelCost(weight);

            var expectedCost = 50;

            Assert.Equal(expectedCost, testCost);
        }
Exemplo n.º 3
0
        public void ShouldCreateAParcelOrderAndSetTheTotalForAHeavyParcel()
        {
            var length     = 1;
            var width      = 1;
            var heigth     = 1;
            var weight     = 100d;
            var testParcel = new Parcel(length, width, heigth, weight);

            var testParcelOrder = new ParcelOrder(testParcel);

            var expectedTotalCost = WeightLimit.GetHeavyParcelCost(weight);

            Assert.Single(testParcelOrder.Parcels);
            Assert.Equal(expectedTotalCost, testParcelOrder.TotalCost);
            Assert.All(testParcelOrder.Parcels, x =>
            {
                Assert.Equal(expectedTotalCost, x.Cost);
            });
            Assert.Null(testParcelOrder.SpeedyShippingCost);
        }