예제 #1
0
        public void AllLaborModulesForRolesMatchingSubmoduleNotRoleTest()
        {
            var roleItem = new Role {
                Name = "WrongRole"
            };

            roleItem.Modules = new List <Module>
            {
                new Module {
                    Type = ModuleType.Sub, AreaName = "Labor", Roles = new List <Role> {
                        roleItem
                    }
                }
            };
            var rolesListQuery = new List <Role>
            {
                roleItem
            };
            var genericRepo =
                MockHelperBll.GetAllRoles(
                    rolesListQuery.AsQueryable()
                    );

            var target = new BabyDiaperLaborHomeBll
            {
                RoleRepository = genericRepo
            };

            var rolenamesList = new List <String>
            {
                "TestRole"
            };

            var actual = target.AllLaborModulesForRoles(rolenamesList);

            Assert.Equal(0,
                         actual.ToList()
                         .Count);
        }
예제 #2
0
        public void AllLaborModulesForRolesNoMatchTest()
        {
            var rolesListQuery = new List <Role>();
            var genericRepo    =
                MockHelperBll.GetAllRoles(
                    rolesListQuery.AsQueryable()
                    );

            var target = new BabyDiaperLaborHomeBll
            {
                RoleRepository = genericRepo
            };

            var rolenamesList = new List <String>
            {
                "TestRole"
            };

            var actual = target.AllLaborModulesForRoles(rolenamesList);

            Assert.Equal(0,
                         actual.ToList()
                         .Count);
        }