Exemple #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));
        }
Exemple #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));
        }
Exemple #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);
        }