Cleanup repo to follow best practices (#3291)

* Fix LRO patterns

* Replace UnitTest and LiveTest with Test
This commit is contained in:
Alan Zimmer authored and GitHub committed 2026-08-18 14:26:30 -04:00
1 parent 4eb0bf49e8
commit e8aa497bc0
26 files changed
+75 -60

No files matched your search

+3 -3
View File
@@ -52,14 +52,14 @@
<Project Path="eng/tools/ToolDescriptionEvaluator/src/ToolDescriptionEvaluator.csproj" />
</Folder>
<Folder Name="/eng/tools/ToolDescriptionEvaluator/tests/">
<Project Path="eng/tools/ToolDescriptionEvaluator/tests/ToolDescriptionEvaluator.UnitTests/ToolDescriptionEvaluator.UnitTests.csproj" />
<Project Path="eng/tools/ToolDescriptionEvaluator/tests/ToolDescriptionEvaluator.Tests/ToolDescriptionEvaluator.Tests.csproj" />
</Folder>
<Folder Name="/eng/tools/ToolMetadataExporter/" />
<Folder Name="/eng/tools/ToolMetadataExporter/src/">
<Project Path="eng/tools/ToolMetadataExporter/src/ToolMetadataExporter.csproj" />
</Folder>
<Folder Name="/eng/tools/ToolMetadataExporter/tests/">
<Project Path="eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.UnitTests/ToolMetadataExporter.UnitTests.csproj" />
<Project Path="eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.Tests/ToolMetadataExporter.Tests.csproj" />
</Folder>
<Folder Name="/eng/tools/VallyEvaluator/" />
<Folder Name="/eng/tools/VallyEvaluator/src/">
@@ -310,7 +310,7 @@
<Project Path="tools/Azure.Mcp.Tools.Insights/src/Azure.Mcp.Tools.Insights.csproj" />
</Folder>
<Folder Name="/tools/Azure.Mcp.Tools.Insights/tests/">
<Project Path="tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.UnitTests/Azure.Mcp.Tools.Insights.UnitTests.csproj" />
<Project Path="tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.Tests/Azure.Mcp.Tools.Insights.Tests.csproj" />
</Folder>
<Folder Name="/tools/Azure.Mcp.Tools.IoTHub/" />
<Folder Name="/tools/Azure.Mcp.Tools.IoTHub/src/">
@@ -9,7 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{02EA681E-C7D
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{6F3DF750-4119-4D28-986A-3F22EF16E71E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolDescriptionEvaluator.UnitTests", "tests\ToolDescriptionEvaluator.UnitTests\ToolDescriptionEvaluator.UnitTests.csproj", "{85D39AC2-463F-44B4-9A6C-8FD9E6E3BA1F}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolDescriptionEvaluator.Tests", "tests\ToolDescriptionEvaluator.Tests\ToolDescriptionEvaluator.Tests.csproj", "{85D39AC2-463F-44B4-9A6C-8FD9E6E3BA1F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1,15 +1,11 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.VectorData;
using ToolSelection.VectorDb;
using Xunit;
namespace ToolDescriptionEvaluator.UnitTests;
namespace ToolDescriptionEvaluator.Tests;
public class InMemoryVectorStoreCollectionTests
{
@@ -1,14 +1,11 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.VectorData;
using ToolSelection.VectorDb;
using Xunit;
namespace ToolDescriptionEvaluator.UnitTests;
namespace ToolDescriptionEvaluator.Tests;
public class VectorDBTests
{
@@ -3,5 +3,5 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("ToolMetadataExporter.UnitTests")]
[assembly: InternalsVisibleTo("ToolMetadataExporter.Tests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
@@ -8,7 +8,7 @@ using ToolMetadataExporter.Models;
using ToolMetadataExporter.Services;
using Xunit;
namespace ToolMetadataExporter.UnitTests.Models;
namespace ToolMetadataExporter.Tests.Models;
public class RunInformationTests
{
@@ -9,7 +9,7 @@ using ToolMetadataExporter.Models;
using ToolMetadataExporter.Services;
using Xunit;
namespace ToolMetadataExporter.UnitTests.Services;
namespace ToolMetadataExporter.Tests.Services;
public class AzmcpProgramTests
{
@@ -11,7 +11,7 @@ using ToolMetadataExporter.Models.Kusto;
using ToolMetadataExporter.Services;
using Xunit;
namespace ToolMetadataExporter.UnitTests.Services;
namespace ToolMetadataExporter.Tests.Services;
public class AzureMcpKustoDatastoreTests : IDisposable
{
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using NSubstitute;
@@ -11,7 +10,7 @@ using ToolMetadataExporter.Services;
using ToolSelection.Models;
using Xunit;
namespace ToolMetadataExporter.UnitTests;
namespace ToolMetadataExporter.Tests;
public class ToolAnalyzerTests : IDisposable
{
+1 -1
View File
@@ -10,7 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ToolMetadataExporter", "Too
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolMetadataExporter", "ToolMetadataExporter\src\ToolMetadataExporter.csproj", "{41A27DC4-E2C0-E36D-EF8E-854DFC376331}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolMetadataExporter.UnitTests", "ToolMetadataExporter\tests\ToolMetadataExporter.UnitTests\ToolMetadataExporter.UnitTests.csproj", "{8B9656E4-84BE-0199-1E72-B4E5B713E059}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolMetadataExporter.Tests", "ToolMetadataExporter\tests\ToolMetadataExporter.Tests\ToolMetadataExporter.Tests.csproj", "{8B9656E4-84BE-0199-1E72-B4E5B713E059}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CopilotCliTester", "CopilotCliTester", "{956495E3-FC37-4BA1-838B-973B97FD8AB2}"
EndProject
@@ -247,7 +247,7 @@
<Project Path="../../tools/Azure.Mcp.Tools.Insights/src/Azure.Mcp.Tools.Insights.csproj" />
</Folder>
<Folder Name="/tools/Azure.Mcp.Tools.Insights/tests/">
<Project Path="../../tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.UnitTests/Azure.Mcp.Tools.Insights.UnitTests.csproj" />
<Project Path="../../tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.Tests/Azure.Mcp.Tools.Insights.Tests.csproj" />
</Folder>
<Folder Name="/tools/Azure.Mcp.Tools.IoTHub/" />
<Folder Name="/tools/Azure.Mcp.Tools.IoTHub/src/">
@@ -74,7 +74,8 @@ public sealed class DppBackupOperations(IAzureService azureService) : BaseAzureS
Azure.ResourceManager.Models.ManagedServiceIdentityType.SystemAssigned)
};
var result = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, vaultData, cancellationToken);
var result = await collection.CreateOrUpdateAsync(WaitUntil.Started, vaultName, vaultData, cancellationToken);
await WaitForLroCompletionAsync(result, cancellationToken);
return new VaultCreateResult(
result.Value.Id?.ToString(),
@@ -288,7 +289,8 @@ public sealed class DppBackupOperations(IAzureService azureService) : BaseAzureS
try
{
operation = await collection.CreateOrUpdateAsync(
WaitUntil.Completed, instanceName, instanceData, cancellationToken);
WaitUntil.Started, instanceName, instanceData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
}
catch (RequestFailedException ex)
{
@@ -754,7 +756,8 @@ public sealed class DppBackupOperations(IAzureService azureService) : BaseAzureS
}
}
await vaultResource.UpdateAsync(WaitUntil.Completed, patchData, cancellationToken);
var operation = await vaultResource.UpdateAsync(WaitUntil.Started, patchData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null, $"Vault '{vaultName}' updated successfully.");
}
@@ -787,7 +790,8 @@ public sealed class DppBackupOperations(IAzureService azureService) : BaseAzureS
try
{
await collection.CreateOrUpdateAsync(WaitUntil.Completed, policyName, policyData, cancellationToken);
var operation = await collection.CreateOrUpdateAsync(WaitUntil.Started, policyName, policyData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
}
catch (RequestFailedException ex) when (ex.Status == 400 && ex.ErrorCode == "UserErrorBMSUpdatePolicyNotSupported")
{
@@ -831,7 +835,8 @@ public sealed class DppBackupOperations(IAzureService azureService) : BaseAzureS
}
}
};
await vaultResource.UpdateAsync(WaitUntil.Completed, patchData, cancellationToken);
var operation = await vaultResource.UpdateAsync(WaitUntil.Started, patchData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null, $"Cross-Region Restore enabled for vault '{vaultName}'.");
}
@@ -872,7 +877,8 @@ public sealed class DppBackupOperations(IAzureService azureService) : BaseAzureS
}
}
};
await vaultResource.UpdateAsync(WaitUntil.Completed, patchData, cancellationToken);
var operation = await vaultResource.UpdateAsync(WaitUntil.Started, patchData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null, $"Immutability set to '{immutabilityState}' for vault '{vaultName}'.");
}
@@ -912,7 +918,8 @@ public sealed class DppBackupOperations(IAzureService azureService) : BaseAzureS
}
}
};
await vaultResource.UpdateAsync(WaitUntil.Completed, patchData, cancellationToken);
var operation = await vaultResource.UpdateAsync(WaitUntil.Started, patchData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null, $"Soft delete set to '{softDeleteState}' for vault '{vaultName}'.");
}
@@ -941,11 +948,12 @@ public sealed class DppBackupOperations(IAzureService azureService) : BaseAzureS
}
};
await proxyCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
var operation = await proxyCollection.CreateOrUpdateAsync(
WaitUntil.Started,
"DppResourceGuardProxy",
proxyData,
cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null, $"Multi-User Authorization enabled on vault '{vaultName}' with Resource Guard '{resourceGuardId}'.");
}
@@ -965,7 +973,8 @@ public sealed class DppBackupOperations(IAzureService azureService) : BaseAzureS
var vaultResource = armClient.GetDataProtectionBackupVaultResource(vaultId);
var proxyResponse = await vaultResource.GetResourceGuardProxyBaseResourceAsync("DppResourceGuardProxy", cancellationToken);
await proxyResponse.Value.DeleteAsync(WaitUntil.Completed, cancellationToken);
var operation = await proxyResponse.Value.DeleteAsync(WaitUntil.Started, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null, $"Multi-User Authorization disabled on vault '{vaultName}'.");
}
@@ -1034,7 +1043,8 @@ public sealed class DppBackupOperations(IAzureService azureService) : BaseAzureS
}
};
await vaultResource.UpdateAsync(WaitUntil.Completed, patchData, cancellationToken);
var operation = await vaultResource.UpdateAsync(WaitUntil.Started, patchData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null,
$"Customer-Managed Key encryption configured on vault '{vaultName}' using key '{keyName}' from '{kvUri}'.");
@@ -45,7 +45,8 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS
}
};
var result = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, vaultData, cancellationToken);
var result = await collection.CreateOrUpdateAsync(WaitUntil.Started, vaultName, vaultData, cancellationToken);
await WaitForLroCompletionAsync(result, cancellationToken);
return new VaultCreateResult(
result.Value.Id?.ToString(),
@@ -535,7 +536,8 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS
}
}
await vaultResource.UpdateAsync(WaitUntil.Completed, patchData, cancellationToken);
var operation = await vaultResource.UpdateAsync(WaitUntil.Started, patchData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
// RSV storage redundancy is managed via the BackupResourceStorageConfig API,
// not the vault patch endpoint.
@@ -573,7 +575,8 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS
var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup);
var rgResource = armClient.GetResourceGroupResource(rgId);
var collection = rgResource.GetBackupResourceConfigs();
await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, data, cancellationToken);
var operation = await collection.CreateOrUpdateAsync(WaitUntil.Started, vaultName, data, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
}
public async Task<OperationResult> CreatePolicyAsync(
@@ -613,7 +616,8 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS
// --policy-tags maps to ARM resource tags on the policy (RSV only).
ApplyPolicyTags(policyData.Tags, request.PolicyTags);
await policyCollection.CreateOrUpdateAsync(WaitUntil.Completed, policyName, policyData, cancellationToken);
var operation = await policyCollection.CreateOrUpdateAsync(WaitUntil.Started, policyName, policyData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null, $"Policy '{policyName}' created in vault '{vaultName}'.");
}
@@ -691,7 +695,8 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS
UpdatePolicyScheduleAndRetention(policyProperties, newScheduleTime, newRetentionDays);
await policyCollection.CreateOrUpdateAsync(WaitUntil.Completed, policyName, policyData, cancellationToken);
var operation = await policyCollection.CreateOrUpdateAsync(WaitUntil.Started, policyName, policyData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null, $"Policy '{policyName}' updated in vault '{vaultName}'.");
}
@@ -836,7 +841,8 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS
}
}
};
await vaultResource.UpdateAsync(WaitUntil.Completed, patchData, cancellationToken);
var operation = await vaultResource.UpdateAsync(WaitUntil.Started, patchData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null, $"Immutability set to '{immutabilityState}' for vault '{vaultName}'");
}
@@ -886,7 +892,8 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS
}
};
await vaultResource.UpdateAsync(WaitUntil.Completed, patchData, cancellationToken);
var operation = await vaultResource.UpdateAsync(WaitUntil.Started, patchData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null, $"Soft delete set to '{softDeleteState}' for vault '{vaultName}'");
}
@@ -932,7 +939,8 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS
var rgId = ResourceGroupResource.CreateResourceIdentifier(subscription, resourceGroup);
var rgResource = armClient.GetResourceGroupResource(rgId);
var collection = rgResource.GetBackupResourceConfigs();
await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, data, cancellationToken);
var operation = await collection.CreateOrUpdateAsync(WaitUntil.Started, vaultName, data, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
}
catch (RequestFailedException ex) when (ex.ErrorCode == "BMSUserErrorRedundancySettingsUseVaultApi")
{
@@ -948,7 +956,8 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS
}
};
await vaultResource.UpdateAsync(WaitUntil.Completed, patchData, cancellationToken);
var operation = await vaultResource.UpdateAsync(WaitUntil.Started, patchData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
}
return new OperationResult("Succeeded", null, $"Cross-Region Restore enabled for vault '{vaultName}'.");
@@ -979,11 +988,12 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS
}
};
await proxyCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
var operation = await proxyCollection.CreateOrUpdateAsync(
WaitUntil.Started,
"VaultProxy",
proxyData,
cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null, $"Multi-User Authorization enabled on vault '{vaultName}' with Resource Guard '{resourceGuardId}'.");
}
@@ -1004,7 +1014,8 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS
var rgResource = armClient.GetResourceGroupResource(rgId);
var proxyResponse = await rgResource.GetResourceGuardProxyAsync(vaultName, "VaultProxy", cancellationToken);
await proxyResponse.Value.DeleteAsync(WaitUntil.Completed, cancellationToken);
var operation = await proxyResponse.Value.DeleteAsync(WaitUntil.Started, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null, $"Multi-User Authorization disabled on vault '{vaultName}'.");
}
@@ -1075,7 +1086,8 @@ public sealed class RsvBackupOperations(IAzureService azureService) : BaseAzureS
}
};
await vaultResource.UpdateAsync(WaitUntil.Completed, patchData, cancellationToken);
var operation = await vaultResource.UpdateAsync(WaitUntil.Started, patchData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return new OperationResult("Succeeded", null,
$"Customer-Managed Key encryption configured on vault '{vaultName}' using key '{keyName}' from '{kvUri}'.");
@@ -1347,7 +1347,7 @@ public class AzureBackupCommandTests(ITestOutputHelper output, TestProxyFixture
/// <summary>
/// End-to-end Disk protection through DPP vault.
/// Validates the Bug #2 (DPP) fix: <c>protecteditem protect</c> waits for the operation
/// to complete (<see cref="Azure.WaitUntil.Completed"/>), reads the backup-instance back,
/// to complete (<see cref="WaitUntil.Completed"/>), reads the backup-instance back,
/// and surfaces a real <c>protectionStatus</c> rather than a fake <c>"Accepted"</c>.
/// Also implicitly validates the Bug #1 fix because protection succeeds only when the
/// DPP vault MSI created by <c>vault create</c> has the right RBAC on the disk + RG.
@@ -3,5 +3,4 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Azure.Mcp.Tools.Insights.UnitTests")]
[assembly: InternalsVisibleTo("Azure.Mcp.Tools.Insights.LiveTests")]
[assembly: InternalsVisibleTo("Azure.Mcp.Tools.Insights.Tests")]
@@ -4,8 +4,6 @@
<OutputType>Exe</OutputType>
<HasLiveTests>false</HasLiveTests>
<HasUnitTests>true</HasUnitTests>
<!-- Suppress MCP9005: tests exercise sampling behaviour; migration to MRTR tracked as Phase 3. -->
<NoWarn>$(NoWarn);MCP9005</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)core\Azure.Mcp.Core\tests\Azure.Mcp.Tests\Azure.Mcp.Tests.csproj" />
@@ -18,7 +18,7 @@ using NSubstitute;
using NSubstitute.ExceptionExtensions;
using Xunit;
namespace Azure.Mcp.Tools.Insights.UnitTests;
namespace Azure.Mcp.Tools.Insights.Tests;
public class InsightsGetCommandTests : CommandUnitTestsBase<InsightsGetCommand, IInsightsService>
{
@@ -354,7 +354,9 @@ public class InsightsGetCommandTests : CommandUnitTestsBase<InsightsGetCommand,
private Task<CommandResponse> ExecuteWithSamplingAsync(params string[] args)
{
var server = Substitute.For<McpServer>();
#pragma warning disable MCP9005 // Type or member is obsolete
server.ClientCapabilities.Returns(new ClientCapabilities { Sampling = new SamplingCapability() });
#pragma warning restore MCP9005 // Type or member is obsolete
var context = new CommandContext() { McpServer = server };
return ((IBaseCommand)Command).ExecuteAsync(context, CommandDefinition.Parse(args), TestContext.Current.CancellationToken);
}
@@ -6,7 +6,7 @@ using Azure.Mcp.Tools.Insights.Services;
using Azure.Mcp.Tools.Insights.Services.Models;
using Xunit;
namespace Azure.Mcp.Tools.Insights.UnitTests.Services;
namespace Azure.Mcp.Tools.Insights.Tests.Services;
public class AggregationFilterTests
{
@@ -6,7 +6,7 @@ using System.Text.Json.Nodes;
using Azure.Mcp.Tools.Insights.Services;
using Xunit;
namespace Azure.Mcp.Tools.Insights.UnitTests.Services;
namespace Azure.Mcp.Tools.Insights.Tests.Services;
public class PropertyAggregatorTests
{
@@ -6,7 +6,7 @@ using ModelContextProtocol.Server;
using NSubstitute;
using Xunit;
namespace Azure.Mcp.Tools.Insights.UnitTests.Services;
namespace Azure.Mcp.Tools.Insights.Tests.Services;
public class SamplingServiceTests
{
@@ -3,4 +3,4 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Azure.Mcp.Tools.IoTHub.UnitTests")]
[assembly: InternalsVisibleTo("Azure.Mcp.Tools.IoTHub.Tests")]
@@ -7,7 +7,7 @@ using Microsoft.Mcp.Tests.Client;
using Microsoft.Mcp.Tests.Client.Helpers;
using Xunit;
namespace Azure.Mcp.Tools.IoTHub.LiveTests;
namespace Azure.Mcp.Tools.IoTHub.Tests;
public class IoTHubCommandTests(
ITestOutputHelper output,
@@ -1,6 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "",
"TagPrefix": "Azure.Mcp.Tools.IoTHub.LiveTests",
"Tag": "Azure.Mcp.Tools.IoTHub.LiveTests_f20674e2d4"
"TagPrefix": "Azure.Mcp.Tools.IoTHub.Tests",
"Tag": "Azure.Mcp.Tools.IoTHub.Tests_7c882c0908"
}
@@ -616,7 +616,8 @@ public sealed class ResilienceManagementService(IAzureService azureService)
}
};
ArmOperation<UsagePlanResource> operation = await usagePlans.CreateOrUpdateAsync(WaitUntil.Completed, usagePlan, usagePlanData, cancellationToken);
ArmOperation<UsagePlanResource> operation = await usagePlans.CreateOrUpdateAsync(WaitUntil.Started, usagePlan, usagePlanData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return MapUsagePlan(operation.Value.Data);
}
@@ -638,7 +639,8 @@ public sealed class ResilienceManagementService(IAzureService azureService)
Properties = new EnrollmentProperties(serviceGroupId)
};
ArmOperation<UsagePlanEnrollmentResource> operation = await enrollments.CreateOrUpdateAsync(WaitUntil.Completed, enrollment, enrollmentData, cancellationToken);
ArmOperation<UsagePlanEnrollmentResource> operation = await enrollments.CreateOrUpdateAsync(WaitUntil.Started, enrollment, enrollmentData, cancellationToken);
await WaitForLroCompletionAsync(operation, cancellationToken);
return MapUsagePlanEnrollment(operation.Value.Data);
}