Legacy Documentation. View NUnit 3 Documentation

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 Initial Display 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.

NUnit provides four sets of Tree Images, which are used to mark tests in the gui as passing, failing, etc. Use the list box to select the preferred set. A preview of the selected set is displayed.

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 check boxes and combo 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

When checked, NUnit captures all output written to Console.Out.

Error Output

When checked, NUnit captures all output written to Console.Error.

Trace Output

When checked, NUnit captures all output written to Trace or Debug.

Log Output

Use the combobox to select the output level. When set to any level other than Off, NUnit captures log4net output at or above that level.

Test Case Labels

Select On to precede text in the output window with the name of the test that produced it. Select All to display a label for every test case, even those that produce no output.


Gui Settings - Project Editor


This page determines what editor is opened when you use the Edit... item on the Project menu.

If you select Use NUnit Project Editor, the NUnit project editor is used.

If you select Use Program and supply a valid executable path, the program you specify will be executed with the full path to the NUnit settings file as it's single argument.


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 - Runtime Selection


This page determines which runtime is used to load tests by default, when no runtime has been specified by the user.

If Select default runtime... is checked, NUnit will examine each test assembly and try to use the runtime for which it was built to load it. If left unchecked, NUnit will use the current runtime to load the assembly.


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.

Principal Policy

Because NUnit access current thread's Principal before running tests, it is not possible to effectively call SetPrincipalPolicy() in a test or in the system being tested.

To remedy this problem, NUnit can callSetPrincipalPolicy() on your behalf. If Set Principal Policy... is checked, NUnit will call it using the PrincipalPolicy type selected in the list when it sets up each test AppDomain


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.

If Use solution configs... is checked, NUnit will make use of solution configs when loading Visual Studio solutions. If it is unchecked, solution configs are ignored and all project configs are included.

This setting is checked by default. Uncheck it if you want NUnit to load solution files compatibly with version 2.5.


Advanced Settings - Internal Trace


Internal Trace

The Trace Level dropdown controls the level of internal trace output.

Log Directory displays the path of the directory to which all internal trace log files are saved.