Reputation: 11971
I am using Visual Studio 2008 and I would like to be able to split up my unit tests into two groups:
I can only see an option to run all or one, and also to run all of the tests in a unit test class.
Is there any way I can split these up or specify which tests to run when I want to run a quick test?
Thanks
Upvotes: 3
Views: 5662
Reputation: 10931
There is the Test List Editor. I'm not at my Visual Studio computer now so I'll just point to this answer.
Upvotes: 1
Reputation: 10346
I would distinguish your unit test groups as follows:
I would create seperate test libraries, i.e. MyProj.UniTests.dll and MyProj.IntegrationTests.dll. This way, your Unit Tests library would have fewer dependenices than your Integration tests. It will then be easy to specify which test group you want to run.
You can set up a continuous integration server, if you are using something like that, to run the tests at different times, knowing that group 1 is quicker than the second. For example, Unit Tests could run immediatley after code is checked in to your repository, and Integration Tests could run overnight. It's easy to set something like this up using Team City
Upvotes: 7
Reputation: 7126
If you're using NUnit, you could use the CategoryAttribute.
The equivalent in MSTest is the TestCategory attribute - see here for a description of how to use it.
Upvotes: 10