Beispiel #1
0
        public async Task CreateOrUpdateAtMgmtGroup()
        {
            //This test uses a pre-created management group.
            ManagementGroup mgmtGroup = await GetCreatedManagementGroup();

            string           policyAssignmentName = Recording.GenerateAssetName("polAssign-");
            PolicyAssignment policyAssignment     = await CreatePolicyAssignment(mgmtGroup, policyAssignmentName);

            Assert.AreEqual(policyAssignmentName, policyAssignment.Data.Name);
            Assert.ThrowsAsync <ArgumentNullException>(async() => _ = await mgmtGroup.GetPolicyAssignments().CreateOrUpdateAsync(true, null, policyAssignment.Data));
            Assert.ThrowsAsync <ArgumentNullException>(async() => _ = await mgmtGroup.GetPolicyAssignments().CreateOrUpdateAsync(true, policyAssignmentName, null));
        }