public static void Main(string[] args)
        {
            var customerTypes = new List <string>
            {
                "Normal", "No Tax", "Holiday"
            };

            var customers = new List <ICustomer>();

            foreach (var customerType in customerTypes)
            {
                customers.Add(SimpleFactory.CreateRetailCustomer(customerType));
            }

            foreach (var customer in customers)
            {
                Console.WriteLine(customer.TotalBill());
            }

            Console.ReadLine();
        }
示例#2
0
 public Inventory()
 {
     Customer = SimpleFactory.CreateRetailCustomer("Gold");
     Customer.TotalBill();
 }