Closed mattrenshawrecorder closed 1 month ago
The requirement to use the BaseContainer
was a workaround for the bug #58 that is fixed now. So you need to simply remove the BaseContainer
, because the container you got is already the global (test run) container.
Reqnroll Version
2.0.2
Which test runner are you using?
NUnit
Test Runner Version Number
NUnit3TestAdapater: 4.50, NUnit 3.13.2
.NET Implementation
.NET 8.0
Test Execution Method
Visual Studio Test Explorer
Content of reqnroll.json configuration file
N/A
Issue Description
When using the Reqnroll.NUnit v2.0x, i'm getting a NullReferenceException when trying to access the ObjectContainer.BaseContainer property in a BeforeTestRunHook:
The same code works when downgrading to Reqnroll.NUnit 1.0.1
Steps to Reproduce
Expected: The test runs and passes
Actual: An exception is thrown when registering objects in the object container. Downgrading to v1.0.1 prevents this error from occurring.![image](https://github.com/reqnroll/Reqnroll/assets/169176092/b52f67d2-c94f-4eb3-b293-fb559291a236)
Link to Repro Project
https://github.com/mattrenshawrecorder/ObjectContainerIssueRecreation