5. Deployment order
We have seen the different deployment
configurations in the above sections. There are multiple places to
specify the deployment items. We can specify on the project level, the
individual test level, and on the method level. But what happens if we
have files with the same name specified in different levels. The answer
is that the file that gets copied later will override the existing file.
There is an order for copying the deployment items. The order is listed
as follows:
- Test assemblies and test files are copied first
- Instrumented binary files
- Items specified in the test run configuration file
- Dependent files and application configuration files
- Test deployment items for each test including the items specified for the test methods
- The deployment items specified for each test has higher precedence over the other files
6. Running tests
Running the test is very simple and easy in
Visual Studio. All the options such as running, rerunning, stopping, and
scheduling the test run are all possible in Visual Studio. The toolbars
available in the Test List Editor, Test View, and the Test Results windows provide all these options.
7. Run and rerun a test
Running the test is done through the following different options provided in Visual Studio:
- Using Test View window
- Using Test List Editor window
- Using the Test Results window
- Using the Source Code editor
The
following is an example for running the test from the Test List Editor.
Select the checkboxes against the tests listed in the editor and then
use the option in the toolbar to run the test. For the other windows,
the toolbar option is very much similar to the Test List Editor.
Whatever
test is selected in the above list, it will start running one after the
other with the result shown in the results window.
8. Pause, resume, and stop a test run
Pausing a test run is like holding the tests
run in its current state until it is restarted again. The screenshot
below shows the three tests under progress. The test is paused using the
toolbar option. This will not affect the current test that is running,
but will stop the next test from running.
The
screenshot above shows that the first test run is complete, but all the
subsequent tests are paused. To restart the remaining tests, select the
Resume Test Run option in the toolbar.
For stopping the test run, choose and click on the Stop
option in the toolbar, which stops all the current test runs. If any
test is running and not yet completed, it will get aborted.
9. Schedule test run
Scheduling a test run cannot be done through
Visual Studio IDE as none of the windows have that option in the
toolbar. This is only possible through the windows scheduler, which can
run the batch program. The batch in turn can use the MSTest command line
test run utility to run the tests.