Skip to content

Commit d2135fd

Browse files
committed
fix unit tests
1 parent 3780fa1 commit d2135fd

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/ResourceManager/Insights/Commands.Insights.Test/ActionGroups/ActionGroupsUtilities.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public static ActionGroupResource CreateActionGroupResource(
5151
enabled: true,
5252
name: name,
5353
groupShortName: shortName,
54+
id:
55+
$"/subscriptions/7de05d20-f39f-44d8-83ca-e7d2f12118b0/resourceGroups/testResourceGroup/providers/microsoft.insights/actionGroups/{name}",
5456
emailReceivers: new List<EmailReceiver> { CreateEmailReceiver("email", "[email protected]") },
5557
smsReceivers: new List<SmsReceiver> { CreateSmsReceiver("sms", "4254251234") },
5658
webhookReceivers: new List<WebhookReceiver> { CreateWebhookReceiver("webhook", "http://test.com") });

src/ResourceManager/Insights/Commands.Insights.Test/ActionGroups/SetAzureRmActionGroupCommandTests.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ namespace Microsoft.Azure.Commands.Insights.Test.ActionGroups
3232
public class AddAzureRmActionGroupTests
3333
{
3434
private const string Location = "Global";
35+
36+
private const string ResourceId =
37+
"/subscriptions/7de05d20-f39f-44d8-83ca-e7d2f12118b0/resourceGroups/testResourceGroup/providers/microsoft.insights/actionGroups/ActionGroupName";
38+
3539
private readonly SetAzureRmActionGroupCommand cmdlet;
3640
private readonly Mock<MonitorManagementClient> insightsManagementClientMock;
3741
private readonly Mock<IActionGroupsOperations> insightsOperationsMock;
@@ -54,9 +58,12 @@ public AddAzureRmActionGroupTests(Xunit.Abstractions.ITestOutputHelper output)
5458
};
5559

5660
response = new AzureOperationResponse<ActionGroupResource>()
57-
{
58-
Body = new ActionGroupResource()
59-
};
61+
{
62+
Body =
63+
ActionGroupsUtilities.CreateActionGroupResource(
64+
name: "ActionGroupName",
65+
shortName: "AgShortName")
66+
};
6067

6168
insightsOperationsMock.Setup(f => f.CreateOrUpdateWithHttpMessagesAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<ActionGroupResource>(), It.IsAny<Dictionary<string, List<string>>>(), It.IsAny<CancellationToken>()))
6269
.Returns(Task.FromResult(response))

0 commit comments

Comments
 (0)