41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using Xunit;
|
|
|
|
namespace StellaOps.Router.Gateway.Tests;
|
|
|
|
internal static class IntegrationTestSettings
|
|
{
|
|
public static bool IsEnabled
|
|
{
|
|
get
|
|
{
|
|
var value = Environment.GetEnvironmentVariable("STELLAOPS_INTEGRATION_TESTS");
|
|
return string.Equals(value, "1", StringComparison.OrdinalIgnoreCase)
|
|
|| string.Equals(value, "true", StringComparison.OrdinalIgnoreCase)
|
|
|| string.Equals(value, "yes", StringComparison.OrdinalIgnoreCase);
|
|
}
|
|
}
|
|
}
|
|
|
|
public sealed class IntegrationFactAttribute : FactAttribute
|
|
{
|
|
public IntegrationFactAttribute()
|
|
{
|
|
if (!IntegrationTestSettings.IsEnabled)
|
|
{
|
|
Skip = "Integration tests disabled. Set STELLAOPS_INTEGRATION_TESTS=true to enable.";
|
|
}
|
|
}
|
|
}
|
|
|
|
public sealed class IntegrationTheoryAttribute : TheoryAttribute
|
|
{
|
|
public IntegrationTheoryAttribute()
|
|
{
|
|
if (!IntegrationTestSettings.IsEnabled)
|
|
{
|
|
Skip = "Integration tests disabled. Set STELLAOPS_INTEGRATION_TESTS=true to enable.";
|
|
}
|
|
}
|
|
}
|
|
|