Пример #1
0
        static List <Employee> MockEmployee()
        {
            List <Employee> employees = new List <Employee>();
            CommonEmployee  e1        = new CommonEmployee()
            {
                Name   = "e1",
                Job    = "打工仔",
                Sex    = Sex.Man,
                Salary = 5000
            };
            CommonEmployee e2 = new CommonEmployee()
            {
                Name   = "e2",
                Job    = "打工仔2号",
                Sex    = Sex.Female,
                Salary = 6000
            };
            Manager manager = new Manager()
            {
                Sex         = Sex.Female,
                Performance = "呵呵",
                Name        = "Ma",
                Salary      = 6000
            };

            employees.Add(e1);
            employees.Add(e2);
            employees.Add(manager);
            return(employees);
        }
Пример #2
0
        static List <Employee> mockEmployee()
        {
            var emplist  = new List <Employee>();
            var zhangsan = new CommonEmployee();

            zhangsan.SetName("张三");
            zhangsan.SetSalary(10000);
            zhangsan.SetJob("编写C#代码。!");
            emplist.Add(zhangsan);

            var lisi = new CommonEmployee();

            lisi.SetName("李四");
            lisi.SetSalary(10000);
            lisi.SetJob("编写python代码。!");
            emplist.Add(lisi);

            var wangwu = new Manager();

            wangwu.SetName("王五");
            wangwu.SetSalary(20000);
            wangwu.SetPerformance("绝对不是负值,我们持平。!");
            emplist.Add(wangwu);

            return(emplist);
        }