public void TestSingleOrDefault_not_data() { var employees = RepositoryFactory.GetEmployees(); Assert.Null(WithoutLinq.CashSingleOrDefault(employees, a => a.Role == RoleType.Unknown)); Assert.Null(employees.CashSingleOrDefault(a => a.Role == RoleType.Unknown)); }
public void TestSingleOrDefault_more_then_one_data() { var employees = RepositoryFactory.GetEmployees(); Assert.Null(WithoutLinq.CashSingleOrDefault(employees, a => a.Role == RoleType.Engineer)); Assert.Null(employees.CashSingleOrDefault(a => a.Role == RoleType.Engineer)); }
public void TestSingeOrDefault() { var employees = RepositoryFactory.GetEmployees(); Assert.Equal(RoleType.Manager, WithoutLinq.CashSingleOrDefault(employees, a => a.Role == RoleType.Manager).Role); Assert.Equal(RoleType.Manager, employees.CashSingleOrDefault(a => a.Role == RoleType.Manager).Role); }