Handle NUnit Framework Compatibility across Target Frameworks
mainThe NUnitBridgedTestFramework should use conditional compilation to handle initialization and test outcome reporting across different .NET runtimes.
Supported Frameworks & Behaviors:
- .NET 5.0, 8.0, 9.0, 11.0, and .NET Standard 2.0: Use
TestOutcome.Skippedfor cancelled tests. - .NET Framework (4.6.2, 4.7.2, 4.8): Use
TestOutcome.Nonefor cancelled tests to maintain compatibility.
// Inside CompleteAllRunningTestsWithCorrectMessages
testNode.Properties.Add(new TestResultProperty(
#if NET9_0 || NET8_0 || NET11_0
TestOutcome.Skipped,
#elif NET5_0
TestOutcome.Skipped,
#elif NET48 || NET472 || NET462
TestOutcome.None, // .NET Framework compatibility
#elif NETSTANDARD2_0
TestOutcome.Skipped,
#else
TestOutcome.None,
#endif
"Test cancelled due to parallel execution timeout"));