
Run Unit Tests Inside Visual Studio #93
Chapter 13, Enhancing Visual Studio
|
425
HACK
tests are sent to the Test output pane and task list in a similar fashion to
other Run Test(s) commands. Trace, debug, and console output is sup-
pressed when executing all tests in a project or solution.
Similarly, all tests in a solution can be executed by right-clicking on the solu-
tion in the Solution Explorer window and selecting Run Test(s). For each
project in the solution, the test framework being used is established and
tests are executed using the correct test runner. Projects that do not contain
any tests are simply ignored.
Aborting a Test Run
When a test run is in progress, an Abort Test menu item will appear on the
Tools menu, as shown in Figure 13-7. Selecting this item will abort the
thread the tests are executing on. When tests are aborted in this way, any
cleanup logic is given a chance to run.
Stopping the Test Process
You will sometimes need to stop the test process. The most common of
these circumstances is when an app domain is created, but not unloaded by
a test run. This can result in any assemblies loaded by the app domain being
locked, which causes subsequent builds to fail. It is possible to recycle the
test process by right-clicking on the rocket icon in the notify box and select-
ing Stop, as shown in Figure 13-8. A new test process will be launched the
next time the Run Test(s) command ...