Ejemplo n.º 1
0
            public void GivenParcelWithSumOfItems_ThenShippingPriceIsCorrect(
                Parcel parcel,
                decimal shippingCosts
                )
            {
                var sut = new ShippingCostsService();

                var parcelShippingCosts = sut.CalculateShippingCosts(
                    parcel
                    );

                ((decimal)parcelShippingCosts).Should().Be(
                    shippingCosts,
                    $"because the cost of shipping {parcel.TotalWeight} grams is {shippingCosts} euro"
                    );
            }
Ejemplo n.º 2
0
            public void GivenParcelWithSumOfItemsIsZeroGrams_ThenShippingPriceIsZeroEuro()
            {
                var parcel = new Parcel(
                    new Item(0),
                    new Item(0)
                    );

                var sut = new ShippingCostsService();

                var parcelShippingCosts = sut.CalculateShippingCosts(
                    parcel
                    );

                ((decimal)parcelShippingCosts).Should().Be(
                    0m,
                    "because the cost of shipping 1 kilo is 2 euro"
                    );
            }