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);
        }
        static void Main(string[] args)
        {
            var orderProcessor = new OrderProcessor(new ShippingCalculator()); // this is dependency on concrete ShippingCalculator, but its in the main method ... its OK in the Main method. This way we can test classes individually
            var order          = new Order {
                DatePlaced = DateTime.Now, TotalPrice = 100f
            };

            orderProcessor.Process(order);
        }