SpecFlow plugin for using SimpleInjector as a dependency injection framework for step definitions.
Dependabot checks for new versions of
- SpecFlow
- SimpleInjector libraries every month and creates pull requests with updates.
After merge and tagging in GitHub automated action will pack and published update nuget library with updated version.
License: Apache (https://github.com/jguc/SpecFlow.SimpleInjector/blob/master/LICENSE)
NuGet: https://www.nuget.org/packages/SpecFlow.SimpleInjector
Install plugin from NuGet into your SpecFlow project.
PM> Install-Package SpecFlow.SimpleInjector
Create a static method somewhere in the SpecFlow project (recommended to put it into the Support
folder) that returns an SimpleInjector Container
and tag it with the [ScenarioDependencies]
attribute. Configure your dependencies for the scenario execution within the method.
A typical dependency builder method probably looks like this:
[ScenarioDependencies]
public static Container CreateContainer()
{
// create container with the runtime dependencies
var builder = Dependencies.CreateContainer();
//TODO: add customizations, stubs required for testing
return builder;
}
http://gasparnagy.com/2016/08/specflow-tips-customizing-dependency-injection-with-autofac/
- Dependabot added to track SpecFlow and SimpleInjector version changes
- NuGet package deployment automated after new tag is published
- Sample project with unit test update
- Unit tests automated with GitHub actions
- Conversion to .NET Standard 2.0 project (PR#8 by toadicusrex)
- Updated libraries (SpecFlow and SimpleInjector)
- Changed nuget publish process to .NET Standard
- Updated example project
- Support for SpecFlow v3
- Support for SpecFlow v2.2 (PR#2 by davidvesely)
- Updated test project to reflect version changes (thanks to dariusz-wozniak)
- First release supporting SpecFlow v2.1