I discovered that NCrunch never runs our AfterTestRun method.
If i run the tests with ReSharper TestRunner, the method gets called.
Is there a configuration that can fix this problem?
I made a sample project to reproduce the problem, unfortunately I cannot upload it with this post.
But it should be easy to reproduce:
1. Create a new class library project in VS2013
2. Install nuget package nunit and specflow
3. Add a new class with the following source code:
Code:
using System;
using System.Diagnostics;
using NUnit.Framework;
using TechTalk.SpecFlow;
namespace SpecFlowTest
{
[Binding]
public static class TestContext
{
[BeforeScenario]
public static void BeforeScenario()
{
Debug.WriteLine("Before scenario");
}
[AfterScenario]
public static void AfterScenario()
{
Debug.WriteLine("After scenario");
}
[BeforeTestRun]
public static void SetUpFeature()
{
Debug.WriteLine("Before test run");
}
[AfterTestRun]
public static void AfterTestRun()
{
Debug.WriteLine("After test run");
}
}
}
4. Create a test to execute
5. Configure ncrunch
6. Set a breakpoint in the AfterTestRun method
7. Debug the test with ncrunch and with resharper to see the differene
Edit:
NCrunch Version: 2.16.0.13
I hope I am not the only one that has this problem.
Regards
Daniel