NUnitForms Class Library

NUnitFormTest Properties

The properties of the NUnitFormTest class are listed below. For a complete list of NUnitFormTest class members, see the NUnitFormTest Members topic.

Public Instance Properties

CurrentForm This should be marked obsolete. It is used only in combination with the FormType property. If you override the FormType property, then CurrentForm will be initialized (on setup) to an instance of the form whose type you specify. None of the testers require a reference to the active form anymore, so this should not be necessary. It will be marked obsolete soon.
DisplayHidden This property controls whether the separate hidden desktop is displayed for the duration of this test. You will need to override and return true from this property if your test makes use of the keyboard or mouse controllers. (The hidden desktop cannot accept user input.) For tests that do not use the keyboard and mouse controller (most should not) you don't need to do anything with this. The default behavior is fine.
FormType Soon to be marked obsolete. This property specifies the type of form to instantiate before each test. Do not use it anymore.
Keyboard Returns a reference to the current KeyboardController for doing Keyboard tests. I recommend this only when you are writing your own custom controls and need to respond to actual keyboard input to test them properly. In most other cases there is a better way to test for the form's logic.
Mouse Returns a reference to the current MouseController for doing Mouse tests. I recommend this only when you are writing your own custom controls and need to respond to actual mouse input to test them properly. In most other cases there is a better way to test the form's logic.
UseHidden This property controls whether a separate desktop is used at all. I highly recommend that you leave this as returning true. Tests on the separate desktop are faster and safer. (There is no danger of keyboard or mouse input going to your own separate running applications.) However I have heard report of operating systems or environments where the separate desktop does not work. In that case there are 2 options. You can override this method from your test class to return false. Or you can set an environment variable called "UseHiddenDesktop" and set that to "false" Either will cause the tests to run on your original, standard desktop.

See Also

NUnitFormTest Class | NUnit.Extensions.Forms Namespace