Example #1
0
        static void Main(string[] args)
        {
            Console.Write("Payment Method: ");
            var method = Console.ReadLine();

            Computer computer;

            var order = new Order
            {
                AmountOfCores = 4,
                AmountOfRam   = 32,
                CpuFrequency  = 3.0m,
                DriveType     = "ssd"
            };

            var processingService = new OrderProcessingService();


            if (method.ToLower() == "cash")
            {
                computer = processingService.MakeCashPurchase(order, 1500m);
            }
            else
            {
                computer = processingService.MakeCreditPurchase(order);
            }

            GiveComputerToCustomer(computer);

            Console.Read();
        }