예제 #1
0
        public void TestFirstOrDefault()
        {
            var employees = RepositoryFactory.GetEmployees();

            Assert.Equal("Kevin", WithoutLinq.CashFirstOrDefault(employees, a => a.MonthSalary > 200).Name);
            Assert.Null(WithoutLinq.CashFirstOrDefault(employees, a => a.MonthSalary > 500));

            Assert.Equal("Kevin", employees.CashFirstOrDefault(a => a.MonthSalary > 200).Name);
            Assert.Null(employees.CashFirstOrDefault(a => a.MonthSalary > 500));
        }