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