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();
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
0
 public async ValueTask DisposeAsync()
 {
     await _client.DeleteRoleAssignmentByIdAsync(RoleAssignmentId);
 }