© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
1 reply
occluder

Assert.Raises<> in xUnit

I'm trying to create tests for certain events. However it seems that xUnit assumes that I use EventHandler<> for my events (see screenshot) which is not true for me.

I have my own delegate for events:
public delegate ValueTask ValueTaskEvent<in Arg1>(Arg1 arg1);
public delegate ValueTask ValueTaskEvent<in Arg1>(Arg1 arg1);


So I'm wondering if there's a way I could test it using my delegate (preferably while still using xUnit). Any help would be appreciated.
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Extending the Assert class in xunit
C#CC# / help
2y ago
xUnit: Can't assert exceptions
C#CC# / help
3y ago
xUnit `MemeberData` function with parameters raises a type error
C#CC# / help
5mo ago
How to fix "Assert.IsAssignableFrom() Failure: Value is null" in Xunit testing?
C#CC# / help
3y ago