AdCodicem.SpecFlow.MicrosoftDependencyInjection 1.0.1

SpecFlow plugin that enables to use Microsoft.Extensions.DependencyInjection for resolving test dependencies.

There is a newer version of this package available.
See the version list below for details.
Install-Package AdCodicem.SpecFlow.MicrosoftDependencyInjection -Version 1.0.1
dotnet add package AdCodicem.SpecFlow.MicrosoftDependencyInjection --version 1.0.1
<PackageReference Include="AdCodicem.SpecFlow.MicrosoftDependencyInjection" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AdCodicem.SpecFlow.MicrosoftDependencyInjection --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AdCodicem.SpecFlow.MicrosoftDependencyInjection, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install AdCodicem.SpecFlow.MicrosoftDependencyInjection as a Cake Addin
#addin nuget:?package=AdCodicem.SpecFlow.MicrosoftDependencyInjection&version=1.0.1

// Install AdCodicem.SpecFlow.MicrosoftDependencyInjection as a Cake Tool
#tool nuget:?package=AdCodicem.SpecFlow.MicrosoftDependencyInjection&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

AdCodicem.SpecFlow.Microsoft.DependencyInjection

AdCodicem.SpecFlow.Microsoft.DependencyInjection is a SpecFlow plugin that enables to use Microsoft.Extensions.DependencyInjection for resolving test dependencies.
It's based on Gáspár Nagy's SpecFlow.Autofac plugin.

Currently supports :

  • SpecFlow 3.0 or above
  • Microsoft.Extensions.DependencyInjection 2.1 or above

License: Apache

NuGet: Nuget

Build Status Build Status

Release Status Release Status

Why this plugin ?

I created this plugin for Specflow because most of my projects use the plain Microsoft.Extensions.DependencyInjection for injecting dependency.
If you've already familiar why ASP.Net Core dependency injection, you won't be lost with this plugin 😉.

Usage

Install plugin from NuGet into your SpecFlow project.

PM> Install-Package AdCodicem.SpecFlow.MicrosoftDependencyInjection

Create a non-static class somewhere in the SpecFlow project implementing the IServicesConfigurator interface.
Configure the dependencies within the method.

You don't have to register the step definition classes as it's already done by this plugin.

⚠️ Do not use other dependency injection plugin for SpecFlow.

A typical dependency configuration class probably looks like this :

public class Startup : IServicesConfigurator
{
    /// <inheritdoc />
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddTransient<ICalculator, Calculator>()
    }
}

Release History

v1.0.1

  • Initial release.
  • Increased minimal Microsoft.Extensions.DependencyInjection version to 2.1.0 to prevent MissingMethodException issue when using an higher version of the NuGet.

AdCodicem.SpecFlow.Microsoft.DependencyInjection

AdCodicem.SpecFlow.Microsoft.DependencyInjection is a SpecFlow plugin that enables to use Microsoft.Extensions.DependencyInjection for resolving test dependencies.
It's based on Gáspár Nagy's SpecFlow.Autofac plugin.

Currently supports :

  • SpecFlow 3.0 or above
  • Microsoft.Extensions.DependencyInjection 2.1 or above

License: Apache

NuGet: Nuget

Build Status Build Status

Release Status Release Status

Why this plugin ?

I created this plugin for Specflow because most of my projects use the plain Microsoft.Extensions.DependencyInjection for injecting dependency.
If you've already familiar why ASP.Net Core dependency injection, you won't be lost with this plugin 😉.

Usage

Install plugin from NuGet into your SpecFlow project.

PM> Install-Package AdCodicem.SpecFlow.MicrosoftDependencyInjection

Create a non-static class somewhere in the SpecFlow project implementing the IServicesConfigurator interface.
Configure the dependencies within the method.

You don't have to register the step definition classes as it's already done by this plugin.

⚠️ Do not use other dependency injection plugin for SpecFlow.

A typical dependency configuration class probably looks like this :

public class Startup : IServicesConfigurator
{
    /// <inheritdoc />
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddTransient<ICalculator, Calculator>()
    }
}

Release History

v1.0.1

  • Initial release.
  • Increased minimal Microsoft.Extensions.DependencyInjection version to 2.1.0 to prevent MissingMethodException issue when using an higher version of the NuGet.

Release Notes

First release

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.1 613 7/13/2020
1.1.0 226 7/13/2020
1.0.2 157 7/6/2020
1.0.1 159 7/2/2020
0.1.9 172 6/26/2020