Settings Dialog

The Settings Dialog is displayed using the Tools | Settings menu item and allows the user to control some aspects of NUnit’s operation. Beginning with NUnit 2.4.4, a tree-based dialog replaced the older tabbed format.


Gui Settings - General


Gui Display

Full Gui

Displays the complete gui - as in prior versions of NUnit. This includes the test result tabs and the progress bar.

Mini Gui

Switches the display to the mini-gui, which consists of the tree display only.

Recent Files

The Display ... files in list TextBox allows the user to choose the number of entries to display in the recent files list.

Normally, NUnit checks that project files still exist before displaying them in the recent files list. This can cause long delays if the file is on a network connection that is no longer available. Unchecking Check that files exist before listing will avoid this delay, so long as the missing file is not actually selected.

If Load most recent project at startup is checked, the GUI will load the last file opened unless it is run with a specific filename or with the /noload parameter.


Gui Settings - Tree Display


Tree View

The list box allows selecting the degree of expansion of the tree when tests are loaded:

Auto – selects a setting based on the space available for the tree display.

Expand – expands all tests

Collapse – collapses all tests

Hide Tests – expands all suites except for the fixtures themselves.

If Clear results when reloading is checked, an automatic or manual reload will reinitialize all test nodes in the tree (grey display) – if it is not checked, result information for tests that do not seem to have changed will be retained.

If Save visual state of each project is checked, NUnit saves the state of the tree and restores it when the project is next opened. The information saved includes which branches of the tree are expanded, the selected node, any checked nodes and any category selection.

If Show Checkboxes is checked, the tree includes checkboxes, which may be used to select multiple tests for running. This setting is also available in the View | Tree menu.

Test Structure

If Automatic Namespace suites is selected, tests will be shown in a hierarchical listing based on namespaces. This is the standard display as used in versions prior to NUnit 2.4.

If Flat list of TestFixtures is selected, tests will be shown as a sequential list of fixtures.


Gui Settings - Test Results


Errors Tab

Check Display Errors and Failures Tab to display the Errors and Failures tab, which shows information about failing tests.

Check Enable Failure ToolTips to display the tip window over the Errors and Failures display and the stack trace. Clear it if you prefer not to see the tip window.

Check Enable Word Wrap to turn on word wrapping in the Errors and Failures display. While you can select this item and the preceding one at the same time, they do not interact well, so you will normally choose one or the other.

Not Run Tab

Check Display Tests Not Run Tab to display the Tests Not Run tab, which shows information about tests that were skipped or ignored.


Gui Settings - Text Output


Select Tab

The Select Tab dropdown list is used to select one of the output tabs, for which settings are to be viewed or changed. It also contains entries that allow you to add a new tab or edit the list of tabs.

The Restore Defaults button is used to restore the default setting, which is a single tab labeled "Text Output." The default tab displays all types of output and includes a label for each test that displays text.

The Title text box is used to modify the title displayed for the selected output tab.

Enabled is checked by default. If you uncheck it, the selected tab will be removed from the tab control. This allows you to temporarily suppress output to a tab without actually removing its definition.

Content

The four check boxes enable or disable a particular type of output on the selected output window. For each type, the display captures output produced while your test is running - either by the test itself or by the program you are testing.

Standard Output

Captures all output written to Console.Out.

Error Output

Captures all output written to Console.Error.

Trace Output

Captures all output written to Trace or Debug.

Log Output

Captures output written to a log4net log. NUnit captures all output at the Error level or above unless another level is specified for the DefaultLogThreshold setting in the configuration file for the test assembly or project.

Test Labels

Check Display TestCase Labels to precede text in the output window with the name of the test that produced it.

Check Suppress label if no output is displayed to eliminate display of labels for tests that produce no output in the window.


Test Loader Settings - Assembly Isolation


Default Process Model

These settings determine NUnit's default use of operating system processes and may be overridden by settings in the NUnit project.

If Run tests directly in the NUnit process is selected, all tests are run in a test domain in the same process as NUnit. This is the way previous versions of NUnit ran tests and is the default setting.

If Run tests in a single separate process is selected, a separate process is used for all tests.

If Run tests in a separate process per Assembly is selected, a separate process is used for each test assembly.

Default Domain Usage

If Use a separate AppDomain per Assembly is selected, each assembly in a multiple-assembly test run will be loaded in a separate AppDomain. This setting is not available when Run tests in a separate process per Assembly is selected above.

If Use a single AppDomain for all tests is selected, all assemblies in a multiple-assembly test run will use the same AppDomain. This was the standard behavior of NUnit prior to version 2.4 and is the default setting.

If Merge tests across assemblies is checked, the display of tests will not be divided across assemblies. If automatic namespace suites are used, they will be merged across all assemblies. This option is only available when tests are run in the same appdomain.


Test Loader Settings - Assembly Reload


Assembly Reload

If Reload before each test run is checked, a reload will occur whenever the run button is pressed whether the assemblies appear to have changed or not.

If Reload when test assembly changes is checked, assemblies are watched for any change and an automatic reload is initiated. This item is disabled on Windows 98 or ME.

If Re-run last tests run is checked, tests are re-run whenever a Reload takes place.


Test Loader Settings - Advanced


Shadow Copy

NUnit normally uses .Net shadow-copying in order to allow you to edit and recompile assemblies while it is running. Uncheck this box to disable shadow-copy only if you have a particular problem that requires it.

Note: If you are tempted to disable shadow copy in order to access files in the same directory as your assembly, you should be aware that there are alternatives. Consider using the Assembly.Codebase property rather than Assembly.Location.


IDE Support Settings - Visual Studio


Visual Studio

If Enable Visual Studio Support is checked, the user will be able to open Visual Studio projects and solutions and add Visual Studio projects to existing test projects.