In the previous post you have learned how to get started with Unit Test in Visual Studio (How to write your very first Unit Test in Visual Studio using MSTest Framework easily ?) . Now it’s the time to manage the explore your Unit Tests in Visual Studio. The objective of the Test Explorer is to quickly access to test methods and execute then efficiently and as and when they are required. Once solution is build, all the test methods discovered automatically by the Visual Studio and listed in Test Explorer in “Not Run Tests” status. Then onwards, based of the execution status of the test method, the indication / status of methods change.
To open the Test Explorer , Navigate to Test –> Windows –> Test Explorer from the main menu.
If your solution has not build yet and you open the Test Explorer, it will display a message as below to ask build the solution so the Visual Studio can discover the test methods. Then only you would be able to execute them.
Once you build the solution, Test Explorer will list out all the test methods with “Not Run Tests” group.
From here you can “Run All” or Run specific test method / run selected test methods.
Once the execution is completed, all the test method status ( Passed, Failed, Skipped etc.) would be updated in the list and you can group them to view in different category.
By selecting the failed test cased, the test explorer can also display the error/ failed reasons of the test cases.
The Test Explorer also gives the provision of Run specific test cases like Failed Test, Not Run Test Cases etc. You can explore this list of options, they are very straight forward and easy to run.
Test explorer also support search specific test method – with in class, files , etc. and group by based on duration, outcomes, project etc. The image below shows the same.
Hope this help.
Pingback: Dew Drop – June 11, 2015 (#2033) | Morning Dew
Pingback: Run Tests After Build – Automatically Running Unit Test After Build Success in Visual Studio
Pingback: Windows Live Writer Open Source - The Daily Six Pack
Pingback: Tips of the week 2015-06-08 | Basho on the .NET
Pingback: Create and Run Subset of Unit Test Using Playlist in Visual Studio
Pingback: Step-By-Step working with Unit Test in Visual Studio 2015 | Abhijit's World of .NET
Pingback: Write Unit Test Automatically using IntelliTest in Visual Studio 2015
Pingback: How to copy and share the execution details of Unit Test methods from the Test Explorer in Visual Studio ?
Pingback: Understanding Code Coverage – How to determine which portion of code is being tested in Visual Studio ?