ModuleInitializer in .NET Framework
#1445
Closed
TimothyMakkison
started this conversation in
General
Replies: 3 comments 2 replies
|
does this clarify things? https://github.com/VerifyTests/Verify?tab=readme-ov-file#static-settings |
0 replies
usually when i see people wrapping the Verify method, it is an anti-pattern. can you share your wrapper code so i can review it? |
0 replies
I can't believe I missed that in the docs 😅
Yeah it's not the best solution. I didn't do this, I just mentioned it as a potential solution I'd considered. Thanks for your help, I'm a massive fan of verify 👍 |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hey, reading the docs it suggests that I use
ModuleInitializerto run initialisation code. This works great in .NET 5+ but what do I do for .NET Framework as it is not supported? Is there a pattern or trick here?My current solution is to use a
try catchstatic constructor to run the setup code for the test file that usesVerify. Other than that my only other solution is to wrap the setup code in atry catchstatement and and run it every time I call aVerifymethod wrapperAll reactions