示例#1
0
        public async Task Delete()
        {
            ManagementGroup mgmtGroup = await Client.GetManagementGroups().CreateOrUpdateAsync(Recording.GenerateAssetName("mgmt-group-"), new CreateManagementGroupRequest());

            await mgmtGroup.DeleteAsync();

            var ex = Assert.ThrowsAsync <RequestFailedException>(async() => await mgmtGroup.GetAsync());

            Assert.AreEqual(404, ex.Status);
        }
示例#2
0
        public async Task Delete()
        {
            var mgmtGroupOp = await Client.GetManagementGroups().CreateOrUpdateAsync(WaitUntil.Started, Recording.GenerateAssetName("mgmt-group-"), new CreateManagementGroupOptions());

            await mgmtGroupOp.WaitForCompletionAsync();

            ManagementGroup mgmtGroup = mgmtGroupOp.Value;
            await mgmtGroup.DeleteAsync(WaitUntil.Completed);

            var ex = Assert.ThrowsAsync <RequestFailedException>(async() => await mgmtGroup.GetAsync());

            Assert.AreEqual(404, ex.Status);
        }