Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2307 Fixed bug when feature context can't be resolved at static methods #2315

Merged
merged 2 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ public class AutofacTestObjectResolver : ITestObjectResolver
{
public object ResolveBindingInstance(Type bindingType, IObjectContainer scenarioContainer)
{
var componentContext = scenarioContainer.Resolve<IComponentContext>();
return componentContext.Resolve(bindingType);
if (scenarioContainer.IsRegistered<IComponentContext>())
{
var componentContext = scenarioContainer.Resolve<IComponentContext>();
return componentContext.Resolve(bindingType);
}
return scenarioContainer.Resolve(bindingType);
}
}
}
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Fixes:
+ Cleanup scenario context even after an AfterScenario hook error
+ Load RuntimePlugins to the same AssemblyLoadContext
+ Capture hook errors and call plugin hooks after hook error
+ Fixed context injection in static methods for Autofac plugin https://github.com/SpecFlowOSS/SpecFlow/issues/2307

Changes:
+ Ignore tag handling: generate test framework specific ignore attributes
Expand Down