Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2012: Clear the test results in Test Explorer when re-running a test that previously failed

On running an individual test in VS2012, a window is shown at the bottom of Test Explorer that includes (assuming failure) a red icon with "Test Failed" next to it. There follows the failure message with "elapsed time" directly beneath.

I would like to know simply whether there is a way to clear this window. For instance if I right-click my test and select "Debug Selected Tests", it is somewhat confusing as I step through the test that this test-results window still shows the failure from a past test-run.

like image 510
Coder_Dan Avatar asked Jul 04 '13 14:07

Coder_Dan


People also ask

How do I stop a test case from running in Visual Studio?

You need to close the Test Explorer Window to prevent automatic running.

How do I use test Explorer code in Visual Studio?

Testing Explorer# The Testing Explorer is a tree view to show all the test cases in your workspace. You can select the beaker button on the left-side Activity bar of Visual Studio Code to open it. You can also run/debug your test cases and view their test results from there.

Why is test explorer not working in Visual Studio?

If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer. As you run, write, and rerun your tests, Test Explorer displays the results in default groups of Failed Tests, Passed Tests, Skipped Tests and Not Run Tests. You can change the way Test Explorer groups your tests.

How do I view passed and failed tests in Visual Studio?

If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer (or press Ctrl + E, T). As you run, write, and rerun your tests, Test Explorer displays the results in default groups of Failed Tests, Passed Tests, Skipped Tests and Not Run Tests.

How do I run a test in Visual Studio?

When you build the test project, the tests appear in Test Explorer. If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer (or press Ctrl + E, T). As you run, write, and rerun your tests, the Test Explorer displays the results in a default grouping of Project, Namespace, and Class.

How to delete a test from a test explorer?

The easiest way is to search all of the files under your solution to look for the name (s) of the test (s) that you want to remove. In my case there's a directory called TestStore. I delete that and my test explorer is now empty.


2 Answers

Actually, there is a way - clean and then rebuild your solution. Previous test run results will clear right up.

like image 105
Sparkle Avatar answered Sep 20 '22 01:09

Sparkle


Switch the build to a different configuration - eg if in debug, switch to release. Then switch back to debug. This should cause it reload the tests. If vs fails to reload the tests on switching back - just do a build (not a rebuild) as this will trigger it to reload the tests

like image 30
Danaldo Avatar answered Sep 21 '22 01:09

Danaldo