FFMpegCore/FFMpegCore.Test/Utilities/WindowsOnlyTestMethod.cs
Malte Rosenbjerg f8eff73690 Simplify attribute
Former-commit-id: e51cf7cc63
2023-01-29 23:08:47 +01:00

23 lines
No EOL
721 B
C#

using System.Runtime.InteropServices;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace FFMpegCore.Test.Utilities;
public class WindowsOnlyTestMethod : TestMethodAttribute
{
public override TestResult[] Execute(ITestMethod testMethod)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
var message = $"Test not executed on other platforms than Windows";
{
return new[]
{
new TestResult { Outcome = UnitTestOutcome.Inconclusive, TestFailureException = new AssertInconclusiveException(message) }
};
}
}
return base.Execute(testMethod);
}
}