Skip to content
RachelTucker edited this page Aug 22, 2016 · 5 revisions

Unit tests for the .NET DS3 SDK are written with NUnit.

Using the Console Runner

  1. First Build the SDK from Source
  2. From command line, navigate to the root directory ds3_net_sdk and run the command
    ./packages/NUnit.ConsoleRunner.{version}/tools/nunit3-console.exe TestDs3/bin/Release/TestDs3.dll
    Note that {version} represents the NUnit version

Using the GUI Runner

  1. First Build the SDK from Source
  2. Execute "ds3_net_sdk/packages/NUnit.Runners.{version}/tools/nunit.exe".
  3. Click File -> Open.
  4. Open ds3_net_sdk\TestDs3\bin\Debug\TestDs3.dll.
  5. Click the root of the tree to the left.
  6. Click Run to run the tests.

Debugging Tests

  1. Open the NUnit GUI test runner and select the appropriate DLL as above.
  2. In Visual Studio, click TOOLS -> Attach to Process...
  3. Find and select nunit-agent.exe
  4. Click "Attach"
  5. Click "Run" inside of the NUnit GUI test runner. The Visual Studio debugger will now stop at breakpoints and exceptions.

Generating Code Coverage

  1. Open a cmd window
  2. Run the following commands:
    • cd ds3_net_sdk\TestDs3\bin\Debug
    • runCoverage.bat
    • coverage\index.htm

Using Visual Studio

You can also run the tests directly from paid editions of Visual Studio. To do so, you'll need to install the "NUnit Test Adapter" extension from the Visual Studio Gallery.