-
|
Hi, New to TUnit. I've been playing with the EventReceivers, creating an attribute. ITestStart and ITestEnd event receivers work fine, but not the ITestSkippedEventReceiver. The OnTestSkipped never fires. Am I missing something, or is this an issue? [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)]
public class EventReceiverAttribute : Attribute, ITestStartEventReceiver, ITestEndEventReceiver, ITestSkippedEventReceiver
{
public static readonly List<string> Events = [];
public ValueTask OnTestStart(TestContext context)
{
Events.Add($"TestStart: {context.Metadata.DisplayName}");
return default(ValueTask);
}
public ValueTask OnTestEnd(TestContext context)
{
Events.Add($"TestEnd: {context.Metadata.DisplayName}");
return default(ValueTask);
}
public ValueTask OnTestSkipped(TestContext context)
{
Events.Add($"TestSkipped: {context.Metadata.DisplayName}");
return default(ValueTask);
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
thomhurst
Mar 27, 2026
Replies: 1 comment 1 reply
-
|
@hanx67 can you try the latest version? |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
hanx67
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@hanx67 can you try the latest version?