mirror of
https://github.com/sbroenne/mcp-server-excel.git
synced 2026-09-19 07:53:08 +08:00
cbbc529be9
Verify opt-in IRM tests skip without a configured workbook and registry metadata stamping validates both version fields. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 57225379-2632-4201-98b6-94b43b419f5c
25 lines
797 B
C#
25 lines
797 B
C#
using Xunit;
|
|
|
|
namespace Sbroenne.ExcelMcp.Tests.Helpers;
|
|
|
|
/// <summary>
|
|
/// Skips an opt-in IRM integration test unless TEST_IRM_FILE names an existing workbook.
|
|
/// </summary>
|
|
public sealed class ConfiguredIrmFactAttribute : FactAttribute
|
|
{
|
|
private const string MissingFixtureMessage =
|
|
"Set TEST_IRM_FILE to an existing IRM/AIP-protected workbook to run this opt-in regression.";
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="ConfiguredIrmFactAttribute"/> class.
|
|
/// </summary>
|
|
public ConfiguredIrmFactAttribute()
|
|
{
|
|
var irmTestFile = Environment.GetEnvironmentVariable("TEST_IRM_FILE");
|
|
if (string.IsNullOrWhiteSpace(irmTestFile) || !File.Exists(irmTestFile))
|
|
{
|
|
Skip = MissingFixtureMessage;
|
|
}
|
|
}
|
|
}
|