public async Task DeleteRoleAssignments()
        {
            AccessControlClient   client     = CreateClient();
            RoleAssignmentDetails assignment = await DisposableClientRole.CreateResource(client, this.Recording);

            Response response = await client.DeleteRoleAssignmentByIdAsync(assignment.Id);

            response.AssertSuccess();
        }
        public async Task DeleteRoleAssignments()
        {
            RoleAssignmentsClient assignmentsClient = CreateAssignmentClient();
            RoleDefinitionsClient definitionsClient = CreateDefinitionsClient();

            RoleAssignmentDetails assignment = await DisposableClientRole.CreateResource(assignmentsClient, definitionsClient, TestEnvironment);

            Response response = await assignmentsClient.DeleteRoleAssignmentByIdAsync(assignment.Id);

            response.AssertSuccess();
        }
Esempio n. 3
0
        public async Task CanDeleteRoleAssignments()
        {
            RoleAssignmentsClient assignmentsClient = CreateAssignmentClient();
            RoleDefinitionsClient definitionsClient = CreateDefinitionsClient();

            var createResponse = await DisposableClientRole.CreateResource(assignmentsClient, definitionsClient, TestEnvironment);

            var content = createResponse.Content;

            using var roleAssignmentDetailsJson = JsonDocument.Parse(content.ToMemory());

            Response deleteResponse = await assignmentsClient.DeleteRoleAssignmentByIdAsync(roleAssignmentDetailsJson.RootElement.GetProperty("id").GetString());

            deleteResponse.AssertSuccess();
        }
        public async Task DeleteRoleAssignments()
        {
            AccessControlClient   client     = CreateClient();
            RoleAssignmentDetails assignment = await DisposableClientRole.CreateResource(client, this.Recording);

            Response response = await client.DeleteRoleAssignmentByIdAsync(assignment.Id);

            switch (response.Status)
            {
            case 200:
            case 204:
                break;

            default:
                Assert.Fail($"Unexpected status ${response.Status} returned");
                break;
            }
        }