-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Trait to CollectionDefinition #799
Comments
I need something similar, I have some tests in my project split into those that have state and those that don't. These are marked with the Collection attribute. It would be nice to run them such as |
One implementation I found: http://mac-blog.org.ua/xunit-category-trait/ |
@zwcloud it's a bit simplification of the problem, but does not solve that. Now, I have to mark a method [Trait("Collection", "DB")]
[Collection("DB")] With your solution, I would do [Category("DB")]
[Collection("DB")] But I would like to use |
Closed for age. |
@bradwilson this is still not possible, right? To me it would also be ok, to just have the collection-name added as collection trait |
@TheConstructor That is correct, this is not a feature. If someone wanted to create a PR for this, I wouldn't want to add an automatic trait for every collection, because you potentially run afoul of someone already using a trait named I would be willing to accept a PR that adds traits to tests based on putting trait attributes on the collection definition class itself. That would allow people to add whatever traits that wanted (names and values) in a central location. |
In xUnit and Visual Studio, I would like to group tests marked with the
[Collection("DB")]
attribute in the Test Explorer. I can group test by the[Trait("Collection", "DB")]
attribute only. Is there any way how to assign a specificTrait
to all tests with the[Collection("DB")]
attribute?(I have also asked on SO).
The text was updated successfully, but these errors were encountered: