Beispiel #1
0
        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));
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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);
        }