When writing unit tests it can be helpful to group unit tests using categories.
For example, if I have both unit and integration tests in the same solution I can group the unit tests by adding a trait:
public class MyUnitTests
public void MyTest()
This is fine for small projects, but if there are numerous test classes in a project it can become cumbersome and easy to miss one or two out.
Fortunately it is possible to apply a trait to an entire test project.
At the root of your test project create a folder called
In that folder, create a file named
AssemblyInfo.cs. Copy the following content into the file:
[assembly: AssemblyTrait("Category", "Unit")]
Now all your tests in that project will have the