示例#1
0
        static void Main(string[] args)
        {
            FullTimeEmployee bill = new FullTimeEmployee();
            bill.FirstName = "Bill";
            bill.LastName = "Gates";
            bill.YearsEmployed = 5;

            ContractEmployee steve = new ContractEmployee();
            steve.FirstName = "Steve";
            steve.LastName = "Jobs";
            steve.MonthsEmployed = 2;

            Console.WriteLine("{0} has been employed for {1} years", bill.ShowFullName(), bill.YearsEmployed);
            Console.WriteLine("{0} has been employed for {1} months", steve.ShowFullName(), steve.MonthsEmployed);

            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            FullTimeEmployee emp1 = new FullTimeEmployee
            {
                FirstName = "Bill",
                LastName = "Gates",
                YearsEmployed = 5
            };

            ContractEmployee emp2 = new ContractEmployee
            {
                FirstName = "Steve",
                LastName = "Jobs",
                MonthsEmployed = 2
            };

            Debug.Assert(emp1.ShowFullName() == "Bill Gates", "His name is Bill Gates.");
            Debug.Assert(emp1.YearsEmployed == 5, "He's worked here 5 years.");

            Debug.Assert(emp2.ShowFullName() == "Steve Jobs", "His name is Steve Jobs.");
            Debug.Assert(emp2.MonthsEmployed == 2, "He's worked here 2 months.");
        }
        static void Main(string[] args)
        {
            var bill = new FullTimeEmployee
            {
                FirstName = "Bill",
                LastName = "Gates",
                YearsEmployed = 5
            };

            var steve = new ContractEmployee
            {
                FirstName = "Steve",
                LastName = "Jobs",
                MonthsEmployed = 2
            };

            Debug.Assert(bill.ShowFullName()== "Bill Gates", "This is not Bill's full name!!!!");
            Debug.Assert(bill.YearsEmployed == 5);

            Debug.Assert(steve.ShowFullName() == "Steve Jobs", "This is not Steve's full name!!!!");
            Debug.Assert(steve.MonthsEmployed == 2);
        }
        static void Main(string[] args) {

            FullTimeEmployee bill = new FullTimeEmployee {
                FirstName = "Bill",
                LastName = "Gates",
                YearsEmployed = 5
            };

            Debug.Assert(bill.ShowFullName() == "Bill Gates", "Employee's name is Bill Gates");
            Debug.Assert(bill.YearsEmployed == 5, "Employee has been working for 5 years!");

            ContractEmployee steve = new ContractEmployee {
                FirstName = "Steve",
                LastName = "Jobs",
                MonthsEmployed = 2
            };

            Debug.Assert(steve.ShowFullName() == "Steve Jobs", "Employee's name is Steve Jobs");
            Debug.Assert(steve.MonthsEmployed == 2, "Employee has been working for 2 months!");

            Console.ReadLine();
        }
示例#5
0
        static void Main(string[] args)
        {
            FullTimeEmployee bill = new FullTimeEmployee
            {
                FirstName = "Bill",
                LastName = "Gates",
                YearsEmployed = 5
            };


            ContractEmployee steve = new ContractEmployee
            {
                FirstName = "Steve",
                LastName = "Jobs",
                MonthsEmployed = 2
            };
            Debug.Assert(bill.ShowFullName() == "Bill Gates", "Wrong Person!");
            Debug.Assert(bill.YearsEmployed == 5, "Wrong Employment History!");
            Debug.Assert(steve.ShowFullName() == "Steve Jobs", "Wrong Person!");
            Debug.Assert(steve.MonthsEmployed == 2, "Wrong Employment History!");


        }