public static async ValueTask <RoleAssignmentDetails> CreateResource(RoleAssignmentsClient assignmentsClient, RoleDefinitionsClient definitionsClient, SynapseTestEnvironment testEnvironment)
            {
                string scope = "workspaces/" + testEnvironment.WorkspaceName;

                Guid?  roleID           = (await definitionsClient.ListRoleDefinitionsAsync()).Value.First(x => x.Name == "Synapse Administrator").Id;
                Guid   principalId      = Guid.NewGuid();
                string roleAssignmentId = Guid.NewGuid().ToString();

                return(await assignmentsClient.CreateRoleAssignmentAsync(roleAssignmentId, roleID.Value, principalId, scope));
            }
        public async Task ListRoleAssignments()
        {
            RoleAssignmentsClient assignmentsClient = CreateAssignmentClient();
            RoleDefinitionsClient definitionsClient = CreateDefinitionsClient();

            await using DisposableClientRole role = await DisposableClientRole.Create(assignmentsClient, definitionsClient, TestEnvironment);

            Response <IReadOnlyList <SynapseRoleDefinition> > roleAssignments = await definitionsClient.ListRoleDefinitionsAsync();

            foreach (SynapseRoleDefinition expected in roleAssignments.Value)
            {
                SynapseRoleDefinition actual = await definitionsClient.GetRoleDefinitionByIdAsync(expected.Id.ToString());

                Assert.AreEqual(expected.Id, actual.Id);
                Assert.AreEqual(expected.Name, actual.Name);
            }
            Assert.GreaterOrEqual(roleAssignments.Value.Count, 1);
        }