diff --git a/tests/OpenClaw.Tray.Tests/SettingsRoundTripTests.cs b/tests/OpenClaw.Tray.Tests/SettingsRoundTripTests.cs index 6181bb3..f1996b3 100644 --- a/tests/OpenClaw.Tray.Tests/SettingsRoundTripTests.cs +++ b/tests/OpenClaw.Tray.Tests/SettingsRoundTripTests.cs @@ -215,7 +215,7 @@ public class SettingsRoundTripTests Assert.Null(SettingsData.FromJson("not json at all")); } - [Fact] + [WindowsFact] public void SettingsManager_ProtectsElevenLabsApiKeyForStorage() { var protectedValue = SettingsManager.ProtectSettingSecret("elevenlabs-key"); diff --git a/tests/OpenClaw.Tray.Tests/WindowsFactAttribute.cs b/tests/OpenClaw.Tray.Tests/WindowsFactAttribute.cs new file mode 100644 index 0000000..7b76149 --- /dev/null +++ b/tests/OpenClaw.Tray.Tests/WindowsFactAttribute.cs @@ -0,0 +1,19 @@ +using Xunit; + +namespace OpenClaw.Tray.Tests; + +/// +/// Marks a test that can only run on Windows (e.g. tests that exercise +/// Windows Data Protection API, NTFS reparse points, or other Win32 surfaces). +/// The test is automatically skipped on non-Windows platforms. +/// +public sealed class WindowsFactAttribute : FactAttribute +{ + public WindowsFactAttribute() + { + if (!OperatingSystem.IsWindows()) + { + Skip = "Windows-only: requires a Windows platform API."; + } + } +}