xunit.assemblyfixture icon indicating copy to clipboard operation
xunit.assemblyfixture copied to clipboard

Support IAsyncLifetime?

Open AlexeyRaga opened this issue 2 years ago • 4 comments

Are there any plans for supporting IAsyncLifetime for assembly fixtures?

This would be extremely handy for things like API testing, etc.

Back this issue Back this issue

AlexeyRaga avatar May 30 '23 00:05 AlexeyRaga

I'd love to see this implemented. We regularly do async cleanup in the dispose method, and I'd love to await that properly.

Any progress?

emahiq avatar Nov 08 '23 16:11 emahiq

Have you seen https://github.com/JDCain/Xunit.Extensions.AssemblyFixture? It supports IAsyncLifetime.

siewers avatar Nov 30 '23 20:11 siewers

@siewers I think I looked long time ago. Not sure how maintained that project though, it hasn't been touched for years... Does it work well?

AlexeyRaga avatar Nov 30 '23 21:11 AlexeyRaga

I've been using it for years. There's only a single issue that I've reported that hasn't been fixed, but besides that, it has worked without issues for me. My primary usage is the teardown and setup of my test database and for that, the IAsyncLifetime works as it should.

siewers avatar Nov 30 '23 22:11 siewers