Exemplo n.º 1
0
        public static void ShipProduct()
        {
            var aProduct = new Product() { Name = "Amazon Fire", Price = 100 };
            var anotherProduct = new Product() { Name = "Apple TV", Price = 100 };

            ProductShipper shipper = new ProductShipper();
            shipper.ShipProduct(aProduct, ShippingMethod.DHL);
            shipper.ShipProduct(anotherProduct, ShippingMethod.FedEx);
        }
Exemplo n.º 2
0
        public void ShipProduct(Product product, ShippingMethod method)
        {
            var shipping = CalculateShippingCost(method);
            var total = shipping + product.Price;

            // Charge Customer the {total} amount
            // Not Implemented

            product.Ship(total);
        }