Ejemplo n.º 1
0
        public static void TestCase3()
        {
            Employee salariedEmployee = new SalariedEmployee();
            var      result           = salariedEmployee.Accept(new SalariedPayReport());

            Console.WriteLine(result);

            Employee hourlyEmployee = new HourlyEmployee();

            result = hourlyEmployee.Accept(new HoursPayReport());
            Console.WriteLine(result);


            Employee hourlyEmployee2 = new HourlyEmployee();

            result = hourlyEmployee2.Accept(new SalariedPayReport());
            Console.WriteLine(result);
        }
Ejemplo n.º 2
0
 public string Visit(HourlyEmployee employee)
 {
     // generate the line of the report.
     return("100 Hours and $1000 in total.");
 }