Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,23 @@ public async Task PlacementGroupId()
Assert.AreEqual(removeIdResult, newRemoveIdResult);
Assert.AreEqual(removeIdResult, newRemoveOuterIdResult);
}

[RecordedTest]
[TestCase(null)]
[TestCase(true)]
[TestCase(false)]
public async Task SetTags(bool? useTagResource)
{
SetTagResourceUsage(Client, useTagResource);
var name = Recording.GenerateAssetName("aset-");
var aset = await CreateAvailabilitySetAsync(name);
var tags = new Dictionary<string, string>()
{
{ "key", "value" }
};
AvailabilitySetResource updated = await aset.SetTagsAsync(tags);

Assert.AreEqual(tags, updated.Data.Tags);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core.TestFramework;
using Azure.ResourceManager.Compute.Tests.Helpers;
Expand Down Expand Up @@ -42,5 +43,23 @@ public async Task Get()

ResourceDataHelper.AssertGroup(group1.Data, group2.Data);
}

[RecordedTest]
[TestCase(null)]
[TestCase(true)]
[TestCase(false)]
public async Task SetTags(bool? useTagResource)
{
SetTagResourceUsage(Client, useTagResource);
var name = Recording.GenerateAssetName("testDHG-");
var group = await CreateDedicatedHostGroupAsync(name);
var tags = new Dictionary<string, string>()
{
{ "key", "value" }
};
DedicatedHostGroupResource updated = await group.SetTagsAsync(tags);

Assert.AreEqual(tags, updated.Data.Tags);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core.TestFramework;
using Azure.ResourceManager.Compute.Models;
Expand Down Expand Up @@ -69,5 +70,23 @@ public async Task Update()

Assert.AreEqual(updatedAutoReplaceOnFailure, updatedHost.Data.AutoReplaceOnFailure);
}

[RecordedTest]
[TestCase(null)]
[TestCase(true)]
[TestCase(false)]
public async Task SetTags(bool? useTagResource)
{
SetTagResourceUsage(Client, useTagResource);
var name = Recording.GenerateAssetName("testHost-");
var host = await CreateDedicatedHostAsync(name);
var tags = new Dictionary<string, string>()
{
{ "key", "value" }
};
DedicatedHostResource updated = await host.SetTagsAsync(tags);

Assert.AreEqual(tags, updated.Data.Tags);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core.TestFramework;
using Azure.ResourceManager.Compute.Tests.Helpers;
Expand Down Expand Up @@ -42,5 +43,23 @@ public async Task Get()

ResourceDataHelper.AssertDiskAccess(access1.Data, access2.Data);
}

[RecordedTest]
[TestCase(null)]
[TestCase(true)]
[TestCase(false)]
public async Task SetTags(bool? useTagResource)
{
SetTagResourceUsage(Client, useTagResource);
var name = Recording.GenerateAssetName("testDA-");
var diskAccess = await CreateDiskAccessAsync(name);
var tags = new Dictionary<string, string>()
{
{ "key", "value" }
};
DiskAccessResource updated = await diskAccess.SetTagsAsync(tags);

Assert.AreEqual(tags, updated.Data.Tags);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public async Task Update()
Assert.AreEqual(description, updatedGalleryImage.Data.Description);
}

[RecordedTest]
[TestCase(null)]
[TestCase(true)]
[TestCase(false)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public async Task Update()
Assert.AreEqual(description, updatedGallery.Data.Description);
}

[RecordedTest]
[TestCase(null)]
[TestCase(true)]
[TestCase(false)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,23 @@ public async Task Update()

Assert.AreEqual(newDiskSize, updatedDisk.Data.DiskSizeGB);
}

[RecordedTest]
[TestCase(null)]
[TestCase(true)]
[TestCase(false)]
public async Task SetTags(bool? useTagResource)
{
SetTagResourceUsage(Client, useTagResource);
var name = Recording.GenerateAssetName("testDisk-");
var disk = await CreateDiskAsync(name);
var tags = new Dictionary<string, string>()
{
{ "key", "value" }
};
ManagedDiskResource updated = await disk.SetTagsAsync(tags);

Assert.AreEqual(tags, updated.Data.Tags);
}
}
}
Loading