Files
agent-framework/dotnet/tests/CosmosDB.IntegrationTests/Microsoft.Agents.AI.Runtime.Storage.CosmosDB.Tests/SkipOnEmulatorFactAttribute.cs
T
2025-09-27 06:10:14 +00:00

29 lines
881 B
C#

// Copyright (c) Microsoft. All rights reserved.
using CosmosDB.Testing.AppHost;
namespace Microsoft.Agents.AI.Runtime.Storage.CosmosDB.Tests;
/// <summary>
/// Skip test if running on CosmosDB emulator.
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)]
public sealed class SkipOnEmulatorFactAttribute : FactAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="SkipOnEmulatorFactAttribute"/> class.
/// </summary>
public SkipOnEmulatorFactAttribute()
{
if (CosmosDBTestConstants.UseAspireEmulatorForTesting)
{
this.Skip = "Skipping test on Aspire-configured CosmosDB emulator.";
}
if (CosmosDBTestConstants.UseEmulatorInCICD)
{
this.Skip = "Skipping test on CICD-configured CosmosDB emulator.";
}
}
}