コード例 #1
0
ファイル: Program.cs プロジェクト: Adreynd/Lab-7
        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();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: trjrogers/Lab7
        static void TestWholeSaleCustomer()
        {
            Console.WriteLine("Testing WholeSaleCustomer constructor.");
            WholesaleCustomer wholecus1 = new WholesaleCustomer("Bob", "Vance", "*****@*****.**", "Vance Refrigeration");
            WholesaleCustomer wholecus2 = new WholesaleCustomer("Trevor", "Rogers", "*****@*****.**", "Freelance Programmer");

            Console.WriteLine("Expecting Bob Vance, [email protected] (Vance Refrigeration).\n" + wholecus1.GetDisplayText());
            Console.WriteLine("Expecting Trevor Rogers, [email protected] (Freelance Programmer).\n" + wholecus2.GetDisplayText());
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: leseastingray/lab7
        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();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: leseastingray/lab7
        // WholesaleCustomer Class Test
        static void TestWholesaleCustomer()
        {
            Console.WriteLine("Testing Wholesale Class");

            WholesaleCustomer wholecust1 = new WholesaleCustomer("Brandon", "Bobs", "*****@*****.**", "Bobs Motors");
            WholesaleCustomer wholecust2 = new WholesaleCustomer("Mary", "Scampi", "*****@*****.**", "Scampi Shrimp");

            Console.WriteLine("Expecting Brandon Bobs, bbobs@bobsmotors (Bobs Motors) \n" + wholecust1.GetDisplayText());
            Console.WriteLine("Expecting Mary Scampi, [email protected] (Scampi Shrimp) \n" + wholecust2.GetDisplayText());
            Console.WriteLine();
        }