public async Task GetAllInSubscription() { var collection = await GetDedicatedHostGroupCollectionAsync(); var groupName1 = Recording.GenerateAssetName("testDHG-"); var groupName2 = Recording.GenerateAssetName("testDHG-"); var input = ResourceDataHelper.GetBasicDedicatedHostGroup(DefaultLocation, 2); _ = await collection.CreateOrUpdateAsync(WaitUntil.Completed, groupName1, input); _ = await collection.CreateOrUpdateAsync(WaitUntil.Completed, groupName2, input); DedicatedHostGroupResource group1 = null, group2 = null; await foreach (var group in DefaultSubscription.GetDedicatedHostGroupsAsync()) { if (group.Data.Name == groupName1) { group1 = group; } if (group.Data.Name == groupName2) { group2 = group; } } Assert.NotNull(group1); Assert.NotNull(group2); }
public async Task Get() { var groupName = Recording.GenerateAssetName("testDHG-"); var group1 = await CreateDedicatedHostGroupAsync(groupName); DedicatedHostGroupResource group2 = await group1.GetAsync(); ResourceDataHelper.AssertGroup(group1.Data, group2.Data); }
public async Task Get() { var collection = await GetDedicatedHostGroupCollectionAsync(); var groupName = Recording.GenerateAssetName("testDHG-"); var input = ResourceDataHelper.GetBasicDedicatedHostGroup(DefaultLocation, 2); var lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, groupName, input); DedicatedHostGroupResource group1 = lro.Value; DedicatedHostGroupResource group2 = await collection.GetAsync(groupName); ResourceDataHelper.AssertGroup(group1.Data, group2.Data); }