Replies: 1 comment 6 replies
-
I'd recommend having your application that uses your DataSourceGeneratorAttribute injected as a property in your class, or in the class constructor. Then your method solely uses the matrix attribute |
Beta Was this translation helpful? Give feedback.
6 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.
-
I have a use case where I want to use matrix tests with more than one parameter, and also provide an application (essentially a service provider that creates a fresh application and disposes it after the individual matrix test).
The
MatrixMethodAttribute
andDataSourceGeneratorAttribute
attributes can't be combined, as I cannot decorate a method parameter withDataSourceGeneratorAttribute
and decorating the method withDataSourceGeneratorAttribute
prevents the use ofMatrixMethodAttribute
.I notice that implementing
IDisposable
on the test class and building the service provider into the test class works, but it's not reusable across multiple test classes or easily merged with other test applications.What options do I have to ensure the test methods all get a fresh application that is not reused and reliably disposed of?
Beta Was this translation helpful? Give feedback.
All reactions