Integrations
Integrating Concordion with other tools
This page shows the integrations for C#. Click the toggle buttons above to choose other options.
Test Runners
Concordion.NET provides the Concordion.NUnit addin to run Concordion.NET tests with any NUnit test environment. The Concordion.NUnit addin is compatible with NUnit 2.6.4 as well as any NUnit 3.x.
NUnit 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.).
TestDriven.NET
You can use TestDriven.NET to execute Concordion.NET tests within Visual Studio.
- Download Concordion.NET
- Install TestDriven.NET
- Copy
Concordion.NUnit.dll
into the TestDriven.NET folder under<testdriven.net-installation-path>\NUnit\2.6\addins
. (Concordion.NUnit.dll is available in thetools
folder of Concordion.NET download package, or as a separate download, or from thelib\Concordion
folder of the tutorial project) When updating Concordion.NET, make sure you update this DLL. - To run a test, 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 Test Adapter
Since version 2012, Visual Studio supports 3rd party test runners to execute their tests right inside Visual Studio. This allows 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 will need to adapt your fixture to extend ExecutableSpecification
as follows:
using Concordion.Runners.NUnit;
using NUnit.Framework;
namespace Kickstart.Spec.HelloWorld
{
[TestFixture]
public class HelloWorldTest : ExecutableSpecification
...
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.
To run Concordion.NET tests without the need for addins, you have to derive your test fixtures from the Concordion.Runners.NUnit.ExecutableSpecification class and annotate it with the standard NUnit [TestFixture] annotation.
Resharper
You can run Concordion.NET acceptance tests within Visual Studio with ReSharper
- Download Concordion.NET.
- Install ReSharper.
- Under Resharper > Options > Tools > Unit Testing > NUnit, select the option “Enable NUnit 2x support” and in “Load NUnit Addins” select “Always”.
- If you are using the built-in NUnit, under Resharper > Options > Tools > Unit Testing > NUnit, take note of the NUnit 2.6.4 folder. Create the subfolder addins if it does not exist, and copy Concordion.NUnit.dll to that folder (Concordion.NUnit.dll is available in the
tools
folder of Concordion.NET download package, or as a separate download, or from thelib\Concordion
folder of the tutorial project). When updating Concordion.NET, make sure you update this DLL. - If you aren’t using the built-in NUnit, but your specified NUnit installation (ReSharper > Options > Tools > Unit Testing > NUnit), you have to copy Concordion.NUnit.dll into the used NUnit installation (<nunit-installation-path>\bin\addins). Make sure you are using NUnit version 2.6.4.
- Run your Concordion.NET acceptance tests with ReSharper
- To run a single test directly from the editor: Click on the ReSharper testing icon next to the line of your fixture class definition and select the Run or Debug option in the context menu.
- To run multiple tests: Right click on the element containing the tests of interest in the Solution Explorer and select either the Run Unit Tests or Debug Unit Tests option in the context menu.
When running the automated tests with ReSharper you can see the progress and results in the Unit Test Sessions window:
Standalone NUnit Runners
NUnit provides different runners, which can be used to run your Concordion.NET tests.
NUnit GUI runner
The GUI runner for NUnit 3 is under development. Until it is finished you can use the NUnit GUI runner of version 2.6.4.
- Download Concordion.NET.
- Download and install NUnit.
- Copy into the addin directory of your NUnit installation (
<NUnit-installation-path>\addins
). (Concordion.NUnit.dll is available in thetools
folder of Concordion.NET download package, or as a separate download, or from thelib\Concordion
folder of the tutorial project) When updating Concordion.NET, make sure you update this DLL as well. - 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.
- Select the Concordion.NET test you want to run in the tree view and press the Run button.
The GUI Runner will show the test results, for example:
The Concordion output specifications can be found in the temp directory (on Windows defined by the environment variable %TEMP%, which by default points to is set to your %USERPROFILE%\AppData\Local\Temp
folder, for example C:\Users\<your-windows-user>\AppData\Local\Temp
). Concordion.NET can also be configured to use a different output directory.
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:
- Download Concordion.NET
- Download and install NUnit
- Copy into the addin directory of your NUnit installation (
<NUnit-installation-path>\nunit-console\addins
). (Concordion.NUnit.dll is available in thetools
folder of Concordion.NET download package, or as a separate download, or from thelib\Concordion
folder of the tutorial project) When updating Concordion.NET, make sure you update this DLL. - 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
You can debug your Concordion.NET tests as you would for standard NUnit tests, as described in this debugging NUnit tests article.