static void TestRetailCustomer() { Console.WriteLine("Testing RetailCustomer constructor."); RetailCustomer retailcus1 = new RetailCustomer("John", "Smith", "*****@*****.**", "(541)-123-4567"); RetailCustomer retailcus2 = new RetailCustomer("Jon", "Snow", "*****@*****.**", "(123)-456-7890"); Console.WriteLine("Expecting John Smith, [email protected] ph: (541)-123-4567.\n" + retailcus1.GetDisplayText()); Console.WriteLine("Expecting Jon Snow, [email protected] ph: (123)-456-7890.\n" + retailcus2.GetDisplayText()); }
static void TestCustomerPolymorphism() { Console.WriteLine("Polymorphism tested with GetDisplayText"); Customer cust1 = new Customer("Jake", "Last", "*****@*****.**"); WholesaleCustomer wholecust1 = new WholesaleCustomer("Brandon", "Bobs", "*****@*****.**", "Bobs Motors"); RetailCustomer retailcust1 = new RetailCustomer("Aaron", "Baker", "*****@*****.**", "(555) 555-5555"); Console.WriteLine("GetDisplay Text from Customer Class"); Console.WriteLine("Expecting Jake Last, [email protected] \n" + cust1.GetDisplayText()); Console.WriteLine("GetDisplayText from WholesaleCustomer Class"); Console.WriteLine("Expecting Expecting Brandon Bobs, bbobs@bobsmotors (Bobs Motors) \n" + wholecust1.GetDisplayText()); Console.WriteLine("GetDisplayText from RetailCustomer Class"); Console.WriteLine("Expecting Aaron Baker, [email protected] ph: (555) 555-5555 \n" + retailcust1.GetDisplayText()); Console.WriteLine(); }
static void TestCustomerConstructors() { Customer c1 = new Customer(); WholesaleCustomer ws = new WholesaleCustomer(); RetailCustomer rs = new RetailCustomer(); Customer c2 = new Customer("Nohm", "Chomskey", "*****@*****.**"); WholesaleCustomer ws2 = new WholesaleCustomer("Nohm", "Chomskey", "*****@*****.**", "Ben's Boxing"); RetailCustomer rs2 = new RetailCustomer("Nohm", "Chomskey", "*****@*****.**", "5415555555"); Console.WriteLine("Testing both constructors"); Console.WriteLine("Default constructor. Expecting default values. " + c1.GetDisplayText()); Console.WriteLine("Overloaded constructor. Expecting Nohm Chomskey, nohmchomskey.com. "); Console.WriteLine("Getting " + c2.GetDisplayText()); Console.WriteLine("Testing WholesaleCustomer's constructors and RetailCustomer's constructors."); Console.WriteLine("Expecting default values."); Console.WriteLine("WholesaleCustomer: " + ws.GetDisplayText() + " RetailCustomer: " + rs.GetDisplayText()); Console.WriteLine("Expecting Nohm, Chomskey, [email protected], Ben's boxing and Nohm, Chomskey, [email protected], 5415555555"); Console.WriteLine("Overloaded WholesaleCustomer: " + ws2.GetDisplayText() + " Overloaded RetailCustomer: " + rs2.GetDisplayText()); Console.WriteLine(); }
// RetailCustomer Class Test static void TestRetailCustomer() { Console.WriteLine("Testing Retail Class"); RetailCustomer retailcust1 = new RetailCustomer("Aaron", "Baker", "*****@*****.**", "(555) 555-5555"); RetailCustomer retailcust2 = new RetailCustomer("Cathi", "Davis", "*****@*****.**", "(555) 777-7777"); Console.WriteLine("Expecting Aaron Baker, [email protected] ph: (555) 555-5555 \n" + retailcust1.GetDisplayText()); Console.WriteLine("Expecting Cathi Davis, [email protected] ph: (555) 777-7777 \n" + retailcust2.GetDisplayText()); Console.WriteLine(); }