Stay in touch

Concordion on Facebook Concordion on Google+ Concordion on LinkedIn Concordion on Pinterest Concordion on Twitter

Run Concordion.NET Acceptance Tests with NUnit

Concordion.NET integrates with one of the most popular automated testing frameworks. Concordion.NET provides an NUnit Addin that allows you to run acceptance tests with any NUnit environment that supports NUnit Addins (NUnit version 2.6.4). We describe how to run Concordion.NET tests with

Automated testing with Concordion.NET setup

Similar to the kickstart project described in the Getting Started section, you need to setup your Spec project for automated testing in Visual Studio as follows:

  1. Download Concordion.NET
  2. Make sure that the following DLLs are referenced in your project. You find the Concordion.dll and the necessary OGNL.dll in the lib directory of the package you have downloaded in step 1. The nunit.framework.dll is part of the NUnit installation of your choice (see sections below).
    • Concordion.dll
    • Concordion.NET.dll
    • IKVM.*.dll
    • nunit.framework.dll
    • OGNL.dll
    • xom.dll
  3. Add the attribute [assembly: RequiredAddin("ConcordionNUnitAddin")] to the AssemblyInfo.cs of your project. This tells NUnit that the Concordion-NUnit-Addin is required to run your Concordion.NET tests.
  4. Make sure that you use .NET framework 3.5 or higher as target framework version in your Spec project that contains your Concordion.NET fixture classes.
  5. Make sure that all your executable specification documents have the property "Build Action" set to "Embedded Resource" in your Visual Studio project.
  6. Build your project for automated acceptance testing.

Using the standalone NUnit test runner for automated acceptance testing

NUnit provides different runners, which can be used to run your Concordion.NET tests.

Run Concordion.NET tests with the NUnit GUI runner

  1. Download Concordion.NET.
  2. Download and install NUnit version 2.6.4.
  3. Copy the Concordion.NUnit.dll from the tools directory of your Concordion.NET package into the addin directory of your NUnit installation (<NUnit-installation-path>\bin\addins).
    Please, make sure to use the latest version of this DLL, when you update Concordion.NET.
  4. Load your tests with the NUnit GUI runner.
    Tip: You can open your Visual Studio solutions and/or projects in NUnit, when you activate the IDE Support Settings - Visual Studio.
  5. Select the Concordion.NET test you want to run in the tree view and press the Run button.

You will see the typical green bar, when your tests pass. :-)

TestResult

You can find the resulting report pages in the output directory that can be specified in configuration files of Concordion.NET. By default Concordion.NET places them into the temp directory (on Windows defined by the environment variable %Temp%, which by default points to C:\Users\<your-windows-user>\AppData\Local\Temp).

Run Concordion.NET tests with the console runner

NUnit provides a command line client for test execution, which can be useful for the automation of test execution and integration into other systems (e.g. build systems). You can run your Concordion.NET tests with the NUnit console runner as follows:

  1. Download Concordion.NET.
  2. Download and install NUnit version 2.6.4.
  3. Copy the Concordion.NUnit.dll from the tools directory of your Concordion.NET package into the addin directory of your NUnit installation (<NUnit-installation-path>\bin\addins).
    Please, make sure to use the latest version of this DLL, when you update Concordion.NET.
  4. In the command line window, run the nunit-console application and pass in the DLL containing your Concordion.NET specifications and tests.

Debugging Concordion.NET tests

If you want to debug your Concordion.NET tests, you can do this in the same way as debugging NUnit tests

Using NUnit test runners integrated in Visual Studio

There are several ways to run Concordion.NET automated tests within Visual Studio (e.g. TestDriven.NET, ReSharper, Test Adapter, etc.). Please, find here a summary on how to run Concordion.NET tests right in Visual Studio.

TestDriven.NET

You can use TestDriven.NET to execute Concordion.NET tests within Visual Studio.

  1. Download Concordion.NET.
  2. Install TestDriven.NET
  3. Copy Concordion.NUnit.dll from the tools directory of your Concordion.NET package into the addin directory of the latest NUnit version in the installation directory of TestDriven.NET (<testdriven.net-installation-path>\NUnit\2.6\addins)
  4. To run a test, please use the "Run Test(s)" command of TestDriven.NET on your Concordion.NET fixture class (http://testdriven.net/quickstart.aspx).

When you run Concordion.NET tests with TestDriven.NET in Visual Studio, you should see an output similar to:

------ Test started: Assembly: Kickstart.Spec.dll ------ 
Processed specifications : C:\concordion-test\Kickstart\Spec\HelloWorld\HelloWorld.html
1 passed, 0 failed, 0 skipped, took 0,82 seconds (NUnit 2.6.4).

NUnit Test Adapter

Since version 2012, Visual Studio supports 3rd party test runners to execute their tests right inside Visual Studio. This would allow using the NUnit Test Adapter for Visual Studio to run Concordion.NET tests.

Please note that at the time of writing an issue of the NUnit Test Adapter prevents the execution of Concordion.NET tests based on the NUnit addin. Until the issue is fixed by the NUnit team, you can use Test Runner described below as a work around to run your Concoridon.NET tests with the NUnit Test Adapter.

When you want to use the Test Runner, make sure to remove the [assembly: RequiredAddin("ConcordionNUnitAddin")] from the projects AssemblyInfo.cs. Otherwise the issue in the NUnit Test Adapter prevents your Concordion.NET tests being found by the NUnit Test Adapter.