Open q42jaap opened 3 weeks ago
I can confirm that the issue is reproducible. I am checking it.
Not related to the issue but a side note that the AddReqnrollBindings
call must be configured in the [ScenarioDependencies]
. But even after moving that to the other method, the issue is still there.
I've got the fix.
There is also a workaround: You can depend on the IContainer
in the hook method and resolve the object from there.
Reqnroll Version
2.0.3
Which test runner are you using?
NUnit
Test Runner Version Number
2.0.3
.NET Implementation
.NET 8.0
Test Execution Method
ReSharper Test Runner
Content of reqnroll.json configuration file
No response
Issue Description
I wanted to inject a global Autofac dependency into a
[BeforeTestRun]
static method. Autofac seems to be working fine, but a[BeforeTestRun]
hook uses theTestRunContainer
.Running the tests fail with the error below.
The docs do mention
BeforeTestRun
Steps to Reproduce
dotnet new reqnroll-project
.The error that occurs:
I traced it down to
GetHookContainer
inTestExecutionEngine
, where the test run context has a ObjectContainer from BoDi.Link to Repro Project
https://github.com/q42jaap/MyRepro.Reqnroll.Autofac