示例#1
0
        public void TestFirst()
        {
            var employees = RepositoryFactory.GetEmployees();

            Assert.Equal("Kevin", WithoutLinq.CashFirst(employees, a => a.MonthSalary > 200).Name);
            Assert.Throws <ArgumentNullException>(() => WithoutLinq.CashFirst(employees, a => a.MonthSalary > 500));

            Assert.Equal("Kevin", employees.CashFirst(a => a.MonthSalary > 200).Name);
            Assert.Throws <ArgumentNullException>(() => employees.CashFirst(a => a.MonthSalary > 500));
        }