Skip to content

Commit

Permalink
Adapted NUnitAssemblyRunner to work with the new ITestListenerExt. No…
Browse files Browse the repository at this point in the history
…w the test events arrive at a custom event listener that implements the ITestEventListener from NUnit.Engine.
  • Loading branch information
z002Holpp committed Apr 21, 2024
1 parent 120d308 commit e34b629
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/NUnitFramework/framework/Api/NUnitTestAssemblyRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ private TestExecutionContext CreateTestExecutionContext(ITest loadedTest, ITestL
// Set the listener - overriding runners may replace this
context.Listener = listener;

// Set the listener for extended test events like OneTimeSetUp / OneTimeTearDown
if (listener is ITestListenerExt testListenerExt)
context.ListenerExt = testListenerExt;

int levelOfParallelism = GetLevelOfParallelism(loadedTest);

if (Settings.TryGetValue(FrameworkPackageSettings.RunOnMainThread, out var runOnMainThread) &&
Expand Down

0 comments on commit e34b629

Please sign in to comment.