Xunit.DependencyInjection icon indicating copy to clipboard operation
Xunit.DependencyInjection copied to clipboard

Usage with other Xunit.TestFrameworks

Open harish-venkataramanan-cko opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe. Yes, the issue is, this library solves a real problem, and therefore it is very useful. However, since it has its own XunitTestFramework and that type is sealed, it is very much impossible to use it along with another custom XunitFramework for solving another important problem, eg: writing BDD style tests in Xunit

Describe the solution you'd like Could you please suggest a consistent way in which we can mix and match other XunitTestFrameworks? Maybe, the XunitTestFramework implementation in this library is not sealed so that we can create another framework implementation by inheriting from that?

Describe alternatives you've considered I cannot see any other solution at the moment

Integrate with other XunitTestFrameworks is complicated. Could you provide the package name? I will try to find the solution as much as possible.

pengweiqhca avatar Nov 28 '23 01:11 pengweiqhca

@pengweiqhca Thanks a lot for the response, it is either LightBDD or BDDfy

@pengweiqhca I use this package in our framework. But now, I also want to use AssemblyFixture, which requires declaring custom framework as mentioned here - https://github.com/xunit/samples.xunit/blob/main/AssemblyFixtureExample/Samples.cs. Is there any way for this?

tkeerthivel avatar Dec 13 '23 20:12 tkeerthivel

@pengweiqhca I use this package in our framework. But now, I also want to use AssemblyFixture, which requires declaring custom framework as mentioned here - https://github.com/xunit/samples.xunit/blob/main/AssemblyFixtureExample/Samples.cs. Is there any way for this?

@tkeerthivel service.AddSingleton<MyAssemblyFixture>()

pengweiqhca avatar Dec 14 '23 01:12 pengweiqhca

@pengweiqhca It needed to work with IAsyncLifeTime and after some research in https://github.com/pengweiqhca/Xunit.DependencyInjection/issues/67 I found about IHostedService which exactly solves my requirement. Thank you. Appreciate your support.

tkeerthivel avatar Dec 14 '23 05:12 tkeerthivel