Hi,
I love NCrunch as a product but I'm a bit inexperienced with how to tweak it for certain situations.
In my current case, I have a SpecFlow project using SpecFlow.xUnit (so, generating xUnit tests). I'm using Testcontainers with this project.
My tests are structured in the below way:
- SpecFlow's BeforeTestRun fires, which happens once per test run
- The BeforeTestRun method uses TestContainers to create a Neo4j container
- The tests execute using the database that has been spun up
- The tests end and the container is cleaned up automatically
This works as expected when using the VS and ReSharper test runners. However, with NCrunch, it appears to execute the BeforeTestRun method multiple times, which results in failures due to trying to recreate the container.
I attempted disabling parallel testing in NCrunch but that didn't appear to resolve the issue.
Is there a setting I can tweak so that the BeforeTestRun called by SpecFlow will not be called multiple times?