Skip to content
Open
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 @@ -14,7 +14,6 @@ namespace Azure.Mcp.Core.LiveTests.Services.Telemetry;
public class LinuxInformationProviderTests
{
[Fact]
[Trait("Category", "Live")]
public async Task GetOrCreateDeviceId_WorksCorrectly()
{
Assert.SkipUnless(RuntimeInformation.IsOSPlatform(OSPlatform.Linux),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ namespace Azure.Mcp.Core.LiveTests.Services.Telemetry;
public class MacOSXInformationProviderTests
{
[Fact]
[Trait("Category", "Live")]
public async Task GetOrCreateDeviceId_WorksCorrectly()
{
Assert.SkipUnless(RuntimeInformation.IsOSPlatform(OSPlatform.Linux),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ namespace Azure.Mcp.Core.LiveTests.Services.Telemetry;
public class WindowsInformationProviderTests
{
[Fact]
[Trait("Category", "Live")]
public async Task GetOrCreateDeviceId_WorksCorrectly()
{
Assert.SkipUnless(RuntimeInformation.IsOSPlatform(OSPlatform.Windows),
Expand Down
10 changes: 8 additions & 2 deletions servers/Azure.Mcp.Server/docs/new-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,14 @@ Guidelines:
- ❌ Bad: `_service.{Operation}(Arg.Is<T>(t => t == value)).Returns(return)`
- CancellationToken in mocks: Always use `Arg.Any<CancellationToken>()` for CancellationToken parameters when setting up mocks
- CancellationToken in product code invocation: When invoking real product code objects in unit tests, use `TestContext.Current.CancellationToken` for the CancellationToken parameter
- If any test mutates environment variables, to prevent conflicts between tests, the test project must:
- Reference project `$(RepoRoot)core\Azure.Mcp.Core\tests\Azure.Mcp.Tests\Azure.Mcp.Tests.csproj`
- Include an `AssemblyAttributes.cs` file with the following contents :
```csharp
[assembly: Azure.Mcp.Tests.Helpers.ClearEnvironmentVariablesBeforeTest]
[assembly: Xunit.CollectionBehavior(Xunit.CollectionBehavior.CollectionPerAssembly)]
```

### 7. Integration Tests

Integration tests inherit from `CommandTestsBase` and use test fixtures:
Expand Down Expand Up @@ -1506,8 +1514,6 @@ catch {
Integration tests should use the deployed infrastructure:

```csharp
[Trait("Toolset", "{Toolset}")]
[Trait("Category", "Live")]
public class {Toolset}CommandTests( ITestOutputHelper output)
: CommandTestsBase(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

namespace Azure.Mcp.Tools.Acr.LiveTests;

[Trait("Area", "Acr")]
[Trait("Category", "Live")]
public class AcrCommandTests(ITestOutputHelper output)
: CommandTestsBase(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ public async Task Should_set_and_delete_appconfig_kv()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_set_and_get_appconfig_kv_with_content_type()
{
// arrange
Expand Down Expand Up @@ -392,7 +391,6 @@ public async Task Should_set_and_get_appconfig_kv_with_content_type()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_set_and_get_content_type_directly_using_service()
{
// arrange
Expand Down Expand Up @@ -423,7 +421,6 @@ await _appConfigService.SetKeyValue(
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_set_kv_with_single_tag()
{
// arrange
Expand Down Expand Up @@ -455,7 +452,6 @@ public async Task Should_set_kv_with_single_tag()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_set_kv_with_multiple_tags()
{
// arrange
Expand Down Expand Up @@ -492,7 +488,6 @@ public async Task Should_set_kv_with_multiple_tags()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_set_kv_with_tags_containing_spaces()
{
// arrange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

namespace Azure.Mcp.Tools.AppConfig.UnitTests.Account;

[Trait("Area", "AppConfig")]
public class AccountListCommandTests
{
private readonly IServiceProvider _serviceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

namespace Azure.Mcp.Tools.AppConfig.UnitTests.KeyValue;

[Trait("Area", "AppConfig")]
public class KeyValueDeleteCommandTests
{
private readonly IServiceProvider _serviceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

namespace Azure.Mcp.Tools.AppConfig.UnitTests.KeyValue;

[Trait("Area", "AppConfig")]
public class KeyValueGetCommandTests
{
private readonly IServiceProvider _serviceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

namespace Azure.Mcp.Tools.AppConfig.UnitTests.KeyValue;

[Trait("Area", "AppConfig")]
public class KeyValueSetCommandTests
{
private readonly IServiceProvider _serviceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

namespace Azure.Mcp.Tools.AppConfig.UnitTests.KeyValue.Lock;

[Trait("Area", "AppConfig")]
public class KeyValueLockSetCommandTests
{
private readonly IServiceProvider _serviceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace Azure.Mcp.Tools.AppConfig.UnitTests.Services;

[Trait("Area", "AppConfig")]
public class AppConfigServiceTests
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

namespace Azure.Mcp.Tools.AppLens.UnitTests.Resource;

[Trait("Area", "AppLens")]
public class ResourceDiagnoseCommandTests
{
private readonly IServiceProvider _serviceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Azure.Mcp.Tools.AppService.LiveTests.Database;

[Trait("Area", "AppService")]
[Trait("Command", "DatabaseAddCommand")]
public class DatabaseAddCommandLiveTests(ITestOutputHelper output) : CommandTestsBase(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

namespace Azure.Mcp.Tools.AppService.UnitTests.Commands.Database;

[Trait("Area", "AppService")]
[Trait("Command", "DatabaseAdd")]
public class DatabaseAddCommandTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Azure.Mcp.Tools.Communication.LiveTests;

[Trait("Area", "Communication")]
[Trait("Command", "SmsSendCommand")]
public class CommunicationCommandTests : CommandTestsBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace Azure.Mcp.Tools.Communication.LiveTests.Email;

[Trait("Area", "Communication")]
[Trait("Command", "EmailSendCommand")]
public class EmailSendCommandLiveTests : CommandTestsBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

namespace Azure.Mcp.Tools.Communication.UnitTests.Sms;

[Trait("Area", "Communication")]
[Trait("Category", "Unit")]
public class SmsSendCommandTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

namespace Azure.Mcp.Tools.EventGrid.LiveTests;

[Trait("Area", "EventGrid")]
[Trait("Category", "Live")]
public class EventGridCommandTests(ITestOutputHelper output)
: CommandTestsBase(output)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

namespace Azure.Mcp.Tools.EventGrid.UnitTests.Events;

[Trait("Area", "EventGrid")]
public class EventsPublishCommandTests
{
private readonly IServiceProvider _serviceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

namespace Azure.Mcp.Tools.EventGrid.UnitTests.Subscription;

[Trait("Area", "EventGrid")]
public class SubscriptionListCommandTests
{
private readonly IServiceProvider _serviceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

namespace Azure.Mcp.Tools.EventGrid.UnitTests.Topic;

[Trait("Area", "EventGrid")]
public class TopicListCommandTests
{
private readonly IServiceProvider _serviceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ public async Task Should_list_openai_models()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_create_agent()
{
var projectName = $"{Settings.ResourceBaseName}-ai-projects";
Expand Down Expand Up @@ -457,7 +456,6 @@ public async Task Should_create_agent()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_connect_agent()
{
var projectName = $"{Settings.ResourceBaseName}-ai-projects";
Expand Down Expand Up @@ -488,7 +486,6 @@ public async Task Should_connect_agent()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_list_agents()
{
var projectName = $"{Settings.ResourceBaseName}-ai-projects";
Expand All @@ -513,7 +510,6 @@ public async Task Should_list_agents()
[InlineData("task_adherence", "Task Adherence")]
[InlineData("tool_call_accuracy", "Tool Call Accuracy")]
[InlineData("intent_resolution", "Intent Resolution")]
[Trait("Category", "Live")]
public async Task Should_query_and_evaluate_agent(string evaluatorName, string evaluationMetric)
{
// to be filled in
Expand Down Expand Up @@ -565,7 +561,6 @@ public async Task Should_query_and_evaluate_agent(string evaluatorName, string e
[InlineData("task_adherence", "Task Adherence")]
[InlineData("tool_call_accuracy", "Tool Call Accuracy")]
[InlineData("intent_resolution", "Intent Resolution")]
[Trait("Category", "Live")]
public async Task Should_evaluate_agent(string evaluatorName, string evaluationMetric)
{
// to be filled in
Expand Down Expand Up @@ -1040,7 +1035,6 @@ public async Task Should_get_foundry_resource_using_static_resources()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_create_thread()
{
var projectName = $"{Settings.ResourceBaseName}-ai-projects";
Expand All @@ -1061,7 +1055,6 @@ public async Task Should_create_thread()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_list_threads()
{
var projectName = $"{Settings.ResourceBaseName}-ai-projects";
Expand All @@ -1078,7 +1071,6 @@ public async Task Should_list_threads()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_get_messages()
{
var projectName = $"{Settings.ResourceBaseName}-ai-projects";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace Azure.Mcp.Tools.Marketplace.LiveTests;

[Trait("Area", "Marketplace")]
public class ProductGetCommandTests : CommandTestsBase
{
private const string ProductKey = "product";
Expand All @@ -33,7 +32,6 @@ public ProductGetCommandTests(ITestOutputHelper output) : base(output)
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_get_marketplace_product()
{
var result = await CallToolAsync(
Expand All @@ -53,7 +51,6 @@ public async Task Should_get_marketplace_product()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_get_marketplace_product_with_language_option()
{
var result = await CallToolAsync(
Expand All @@ -74,7 +71,6 @@ public async Task Should_get_marketplace_product_with_language_option()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_get_marketplace_product_with_market_option()
{
var result = await CallToolAsync(
Expand All @@ -95,7 +91,6 @@ public async Task Should_get_marketplace_product_with_market_option()
}

[Fact]
[Trait("Category", "Live")]
public async Task Should_get_marketplace_product_with_multiple_options()
{
var result = await CallToolAsync(
Expand Down
Loading
Loading