Exemple #1
0
        static void Main(string[] args)
        {
            var orderProcessor = new OrderProcessor(new ShippingCalculator());
            var order          = new Order()
            {
                DatePlaced = DateTime.Now, TotalPrice = 100f
            };

            orderProcessor.Process(order);
            Console.WriteLine("Hello World!");
        }
        static void Main(string[] args)
        {
            var orderProcessor = new OrderProcessor(new ShipmentCalculator());
            var order          = new Order {
                DatePlaced = DateTime.Now,
                TotalPrice = 104.0f,
            };

            orderProcessor.Process(order);
            Console.WriteLine(order.shipment.Cost);
        }