Skip to content
Discussion options

You must be logged in to vote

Thanks for reporting this! The docs were indeed missing the registration section for IHookExecutor.

There are two ways to register a hook executor:

1. [HookExecutor<T>] attribute

Apply it directly to your hook methods, class, or assembly:

// On a specific hook method
[Before(Test)]
[HookExecutor<LoggingHookExecutor>]
public async Task SetUp(TestContext context)
{
    // This hook runs through the custom executor
}

// Or at class level (applies to all hooks in the class)
[HookExecutor<LoggingHookExecutor>]
public class MyTestClass { }

// Or at assembly level
[assembly: HookExecutor<LoggingHookExecutor>]

2. SetHookExecutor programmatically

Via ITestRegisteredEventReceiver — useful when yo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by metacoder-feff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants