Skip to content

Commit

Permalink
Support for SpecFlow 2.2.0 (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvesely authored and jguc committed Apr 17, 2018
1 parent 2767daa commit 1e1184a
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SpecFlow plugin for using SimpleInjector as a dependency injection framework for


Currently supports
* SpecFlow v2.1
* SpecFlow v2.2
* SimpleInjector v3.0 or above

License: Apache (https://github.com/jguc/SpecFlow.SimpleInjector/blob/master/LICENSE)
Expand All @@ -24,10 +24,10 @@ Create a static method somewhere in the SpecFlow project (recommended to put it
A typical dependency builder method probably looks like this:

[ScenarioDependencies]
public static ContainerBuilder CreateContainerBuilder()
public static Container CreateContainer()
{
// create container with the runtime dependencies
var builder = Dependencies.CreateContainerBuilder();
var builder = Dependencies.CreateContainer();

//TODO: add customizations, stubs required for testing
builder.Verify();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>SpecFlow.SimpleInjector</id>
<version>1.0.0</version>
<version>1.0.0-localdev</version>
<title>SpecFlow SimpleInjector integration plugin</title>
<authors>Jakub Guc</authors>
<owners>Jakub Guc</owners>
Expand All @@ -17,7 +17,7 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<tags>specflow SimpleInjector di dependency injection</tags>
<dependencies>
<dependency id="SpecFlow" version="2.1.0" />
<dependency id="SpecFlow" version="2.2.0" />
<dependency id="SimpleInjector" version="3.0.0" />
</dependencies>
</metadata>
Expand Down
2 changes: 2 additions & 0 deletions src/SpecFlow.SimpleInjector.SpecFlowPlugin/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration />
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void Initialize(RuntimePluginEvents runtimePluginEvents, RuntimePluginPar
{
runtimePluginEvents.CustomizeGlobalDependencies += (sender, args) =>
{
args.ObjectContainer.RegisterTypeAs<SimpleInjectorBindingInstanceResolver, IBindingInstanceResolver>();
args.ObjectContainer.RegisterTypeAs<SimpleInjectorTestObjectResolver, ITestObjectResolver>();
args.ObjectContainer.RegisterTypeAs<ContainerBuilderFinder, IContainerBuilderFinder>();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace SpecFlow.SimpleInjector
{
public class SimpleInjectorBindingInstanceResolver : IBindingInstanceResolver
public class SimpleInjectorTestObjectResolver : ITestObjectResolver
{
public object ResolveBindingInstance(Type bindingType, IObjectContainer scenarioContainer)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SpecFlow.SimpleInjector</RootNamespace>
<AssemblyName>SpecFlow.SimpleInjector</AssemblyName>
<AssemblyName>SpecFlow.SimpleInjector.SpecFlowPlugin</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
Expand All @@ -30,6 +30,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="SimpleInjector, Version=3.0.0.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
<HintPath>..\packages\SimpleInjector.3.0.0\lib\net45\SimpleInjector.dll</HintPath>
</Reference>
Expand All @@ -41,13 +44,12 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="TechTalk.SpecFlow, Version=2.1.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL">
<HintPath>..\packages\SpecFlow.2.1.0\lib\net45\TechTalk.SpecFlow.dll</HintPath>
<Private>True</Private>
<Reference Include="TechTalk.SpecFlow, Version=2.2.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL">
<HintPath>..\packages\SpecFlow.2.2.0\lib\net45\TechTalk.SpecFlow.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="SimpleInjectorBindingInstanceResolver.cs" />
<Compile Include="SimpleInjectorTestObjectResolver.cs" />
<Compile Include="SimpleInjectorPlugin.cs" />
<Compile Include="BindingRegistryExtensions.cs" />
<Compile Include="ContainerBuilderFinder.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="SimpleInjector" version="3.0.0" targetFramework="net45" />
<package id="SpecFlow" version="2.1.0" targetFramework="net45" />
<package id="SpecFlow" version="2.2.0" targetFramework="net45" />
</packages>
2 changes: 1 addition & 1 deletion src/SpecFlow.SimpleInjector.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetPackages", "NuGetPacka
{1EEFF87C-9EC4-41C5-83B1-6ADE8BAA1E12} = {1EEFF87C-9EC4-41C5-83B1-6ADE8BAA1E12}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpecFlow.SimpleInjector", "SpecFlow.Autofac.SpecFlowPlugin\SpecFlow.SimpleInjector.csproj", "{1EEFF87C-9EC4-41C5-83B1-6ADE8BAA1E12}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpecFlow.SimpleInjector", "SpecFlow.SimpleInjector.SpecFlowPlugin\SpecFlow.SimpleInjector.SpecFlowPlugin.csproj", "{1EEFF87C-9EC4-41C5-83B1-6ADE8BAA1E12}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5778AABB-6831-47CE-B77E-6F4B8C75809F}"
ProjectSection(SolutionItems) = preProject
Expand Down

0 comments on commit 1e1184a

Please sign in to comment.