Creating or Editing NUnit Tests

Note: We recommend that you add the .\bin folder of your NUnit installation to the system path. Click Start > Control Panel > System > Advanced > Environment Variables to add a path like C:\Program Files\NUnit 2.2\bin to the system environment variable PATH.

To create or edit an NUnit test:

  1. In the menu, click Tests > Details View .
  2. Select a container or folder node in the Tests tree where you want to insert a new test, or select the test that you want to edit.
  3. Click New Child Test (New Child Test) on the toolbar, or click (Edit).

    The New Test/Edit Test dialog box appears.

  4. Type a name and description for the test.
    Note: Silk Central supports HTML formatting and cutting and pasting of HTML content for Description fields.
  5. If you are creating a new test, select NUnit Test from the Type list. Click Next.

    The NUnit Test Properties dialog box appears.

  6. Click Browse to locate and select the NUnit assembly from which you want to pull a test.
  7. Type the working directory in the NUnit Directory field.

    For NUnit 2, this directory is the local path to the file nunit-console.exe, such as C:\Program Files\NUnit 2.2\bin. For NUnit 3, this directory is the full path to the file nunit3-console.exe, such as C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe.

  8. In the NUnit Options field, type one or more NUnit console command-line options to specify how NUnit tests are specified. For example, to define that the Flex4TestApp NUnit test, located in SilkTest.Ntf.Test.Flex, should be executed, set the run option as follows:
    For NUnit 2:
    /run:SilkTest.Ntf.Test.Flex.Flex4TestApp
    For NUnit 3:
    /test:SilkTest.Ntf.Test.Flex.Flex4TestApp
    Note: When you add multiple options, you have to separate the options by writing one option in each line in the field.
  9. Click Finish.