Exemple #1
0
        public void TestDistinct()
        {
            var expected = 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 = "Andy", Role = RoleType.OP, MonthSalary = 80, Age = 22, WorkingYear = 2.6
                },
            }.ToExpectedObject();

            expected.ShouldEqual(WithoutLinq.CashDistinct(RepositoryFactory.GetEmployees(), new MyCompareRole())
                                 .ToList());
            expected.ShouldEqual(RepositoryFactory.GetEmployees().CashDistinct(new MyCompareRole()).ToList());
        }