Example #1
0
        public async void AdminRevokesRoleFromUser(string user, string role)
        {
            var statement = new RevokeRoleStatement(user, role);
            var result    = await statement.ExecuteAsync(adminContext);

            Assert.NotNull(result);
            Assert.True(result.IsEmpty());
            Assert.Equal(user, revokedUser);
            Assert.Equal(role, revokedRole);
        }
Example #2
0
        public async void UserRevokesOtherUserRole(string user, string role)
        {
            var statement = new RevokeRoleStatement(user, role);

            await Assert.ThrowsAsync <UnauthorizedAccessException>(() => statement.ExecuteAsync(userContext));
        }