Reputation: 402
I would like to implement Nunit testcontext option in to my specflow ScenarioContext. I tried adding this line manually in the RandomName.Feature.cs file's ScenarioSetup method
testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs<NUnit.Framework.TestContext>(TestContext);
testRunner.ScenarioContext.Add("TestContext", TestContext);
But the name test context does not exist in the current context. Any pointers on how to make use of the Nunit test context in specflow please
Upvotes: 0
Views: 938
Reputation: 3333
TestContext.CurrentContext is required
testRunner.ScenarioContext.ScenarioContainer
.RegisterInstanceAs<NUnit.Framework.TestContext>(TestContext.CurrentContext);
Upvotes: 0