You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use Constructor / Dispose instead of [Before(Test)] / [After(Test)]
Note that this fails the two test with the [NotInParallel] attribute, i.e. FilterPropertyThrowing and ExceptionFormatterThrowing.
The [Test Set Ups][1] and [Test Clean Ups][2] documentation mentions respectively:
> Most setup for a test can be performed in the constructor (think setting up mocks, assigning fields.)
and
> TUnit supports having your test class implement `IDisposable` or `IAsyncDisposable`. These will be called after your test has finished executing.
So I'm not sure what's the difference between Custructor/Dispose and [Before(Test)] / [After(Test)] attributes.
[1]: https://thomhurst.github.io/TUnit/docs/tutorial-extras/setup
[2]: https://thomhurst.github.io/TUnit/docs/tutorial-extras/cleanup
0 commit comments