Question

I have a category of unit test methods ("Serialization") all marked with the CategoryAttribute so that I can sort the Test Explorer pane in VS-2012 by "Trait" like this:

Test Explorer Pane

I have added an Ordered Test (called serialization.orderedtest) to a Unit Test project in my solution and assigned all of these unit test methods to run in a particular sequence.

My question: How can I assign my "Serialization" category to this ordered test object so that it is organized with the others in this view?

** EDIT **

It's been suggested that there might be a Properties option in the right-click context menu for the test items in the VS-2012 Test Explorer. Alas, there is not...

enter image description here

Was it helpful?

Solution

I can verify that in both 2010 and 2012 there is no "Test Categories" field for Ordered Tests. In Coded UI tests there are, but I do not see any way at this time to set an Ordered Test to a category.

That is, through the Test View window in 2010, it does show a "Test Categories" property for the Ordered Test. However, attempts at editing the field result in an error when saving the property. So the edit is not saved and the ordered test remains uncategorized.

OTHER TIPS

You can apply category to any type of tests by the Test View window.

Right click on the test you want and open the Properties. There, in the Test Categories field you can add the category.


My answer is referring to VS-2010, I think is the same in VS-2012. Instead of the Test View window, look for Test Explorer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top