public async Task ShouldThrowError_WhenModifierIsNotFound()
        {
            var tester = await setup();

            var user = await addUser(tester, "some.user");

            await AccessAssertions.Create(tester).ShouldThrowError_WhenModifierIsNotFound(user.ID.Value);
        }
示例#2
0
        public async Task ShouldThrowError_WhenRoleIsNotAssignedToUser()
        {
            var tester = await setup();

            var userToEdit = await addUser(tester, "userToEdit");

            var form = createEditUserForm(userToEdit);
            await AccessAssertions.Create(tester).ShouldThrowError_WhenRoleIsNotAssignedToUser(form);
        }
示例#3
0
        public async Task ShouldThrowError_WhenModifierIsNotFound()
        {
            var tester = await setup();

            var userToEdit = await addUser(tester, "userToEdit");

            var viewAppRole = await getViewAppRole(tester);

            var model = createModel(userToEdit, viewAppRole);
            await AccessAssertions.Create(tester).ShouldThrowError_WhenModifierIsNotFound(model);
        }
示例#4
0
        public async Task ShouldThrowError_WhenModifierIsBlank()
        {
            var tester = await setup();

            var userToEdit = await addUser(tester, "userToEdit");

            var viewAppRole = await getViewAppRole(tester);

            var userRoleID = await assignRole(tester, userToEdit, viewAppRole);

            var request = new UserRoleRequest
            {
                UserID = userToEdit.ID.Value,
                RoleID = userRoleID
            };
            await AccessAssertions.Create(tester).ShouldThrowError_WhenModifierIsBlank(request);
        }
示例#5
0
        public async Task ShouldThrowError_WhenModifierIsNotAssignedToUser()
        {
            var tester = await setup();

            var app = await tester.HubApp();

            var viewAppRole = await app.Role(new AppRoleName(HubInfo.Roles.ViewApp));

            var modifier = await tester.HubAppModifier();

            await AccessAssertions.Create(tester)
            .ShouldThrowError_WhenModifierIsNotAssignedToUser_ButRoleIsAssignedToUser
            (
                new EmptyRequest(),
                viewAppRole,
                modifier
            );
        }
示例#6
0
        public async Task ShouldThrowError_WhenModifierIsNotAssignedToUser()
        {
            var tester = await setup();

            var userToEdit = await addUser(tester, "userToEdit");

            var viewAppRole = await getViewAppRole(tester);

            var model    = createModel(userToEdit, viewAppRole);
            var modifier = await tester.HubAppModifier();

            await AccessAssertions.Create(tester)
            .ShouldThrowError_WhenModifierIsNotAssignedToUser_ButRoleIsAssignedToUser
            (
                model,
                viewAppRole,
                modifier
            );
        }
        public async Task ShouldThrowError_WhenModifierIsNotFound()
        {
            var tester = await setup();

            await AccessAssertions.Create(tester).ShouldThrowError_WhenModifierIsNotFound(new EmptyRequest());
        }