Closed arnaulddumez closed 2 years ago
Hello @arnaulddumez, thanks for your question. Your example (injecting a context class using the constructor) should work using this plugin, please refer to this included test for an example: https://github.com/solidtoken/SpecFlow.DependencyInjection/blob/main/SpecFlow.DependencyInjection.Tests/DependencyInjectionPluginSteps.cs (the dependencies are registered here: https://github.com/solidtoken/SpecFlow.DependencyInjection/blob/main/SpecFlow.DependencyInjection.Tests/TestDependencies.cs).
I am not familiar with TestRunContext
-- the only reference I could find is in the SpecFlow+ Runner API documentation (https://docs.specflow.org/projects/specflow-runner/en/latest/Usage/SpecFlow-Runner-APIs.html). Recently Tricentis announced the retirement of SpecFlow+ Runner (https://specflow.org/using-specflow/the-retirement-of-specflow-runner/) so I'm not keen on spending time on it.
There are difference with default SpecFlow Ioc, the method is static and is not possible to inject TestRunContext like the Specflow sample.
VS
There are equivalent please ?