Exemplo n.º 1
0
        public void two_employee_are_equal_test()
        {
            var firstEmployees = new List <Employee>
            {
                new Employee {
                    Name = "Joe", Role = RoleType.Engineer, MonthSalary = 100, Age = 44, WorkingYear = 2.6
                },
                new Employee {
                    Name = "Tom", Role = RoleType.Engineer, MonthSalary = 140, Age = 33, WorkingYear = 2.6
                },
                new Employee {
                    Name = "Kevin", Role = RoleType.Manager, MonthSalary = 380, Age = 55, WorkingYear = 2.6
                },
                new Employee {
                    Name = "Andy", Role = RoleType.OP, MonthSalary = 80, Age = 22, WorkingYear = 2.6
                },
                new Employee {
                    Name = "Bas", Role = RoleType.Engineer, MonthSalary = 280, Age = 36, WorkingYear = 2.6
                },
                new Employee {
                    Name = "Mary", Role = RoleType.OP, MonthSalary = 180, Age = 26, WorkingYear = 2.6
                },
                new Employee {
                    Name = "Frank", Role = RoleType.Engineer, MonthSalary = 120, Age = 16, WorkingYear = 2.6
                },
                new Employee {
                    Name = "Joey", Role = RoleType.Engineer, MonthSalary = 250, Age = 40, WorkingYear = 2.6
                },
            };
            var secondEmployee = RepositoryFactory.GetEmployees();

            Assert.IsTrue(YourOwnLinq.IsSameEmployee(firstEmployees, secondEmployee, new ChloeEmployeeCompare()));
        }
Exemplo n.º 2
0
        public void two_employee_not_equal_test()
        {
            var firstEmployees = new List <Employee>
            {
                new Employee {
                    Name = "Joe", Role = RoleType.Engineer, MonthSalary = 100, Age = 44, WorkingYear = 2.6
                },
                new Employee {
                    Name = "Kevin", Role = RoleType.Manager, MonthSalary = 380, Age = 55, WorkingYear = 2.6
                },
                new Employee {
                    Name = "Joey", Role = RoleType.Engineer, MonthSalary = 250, Age = 40, WorkingYear = 2.6
                },
            };
            var secondEmployee = RepositoryFactory.GetEmployees();

            Assert.IsFalse(YourOwnLinq.IsSameEmployee(firstEmployees, secondEmployee, new ChloeEmployeeCompare()));
        }