Skip to content
This repository was archived by the owner on Apr 26, 2020. It is now read-only.
Open
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 @@ -31,10 +31,16 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Castle.Core">
<HintPath>..\packages\Castle.Core.3.0.0.4001\lib\net40-client\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Ninject, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll</HintPath>
</Reference>
<Reference Include="Ninject.Extensions.Factory">
<HintPath>..\packages\Ninject.Extensions.Factory.3.0.1.0\lib\net40\Ninject.Extensions.Factory.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ public void Should_be_able_to_resolve_engine()
}

[Fact]
public void GetAllModules_Returns_As_MultiInstance()
public void GetAllModules_With_Different_Contexts_Returns_Different_Instances()
{
// Given
this.bootstrapper.GetEngine();
var context = new NancyContext();
var context1 = new NancyContext();
var context2 = new NancyContext();

// When
var output1 = this.bootstrapper.GetAllModules(context).FirstOrDefault(nm => nm.GetType() == typeof(FakeNancyModuleWithBasePath));
var output2 = this.bootstrapper.GetAllModules(context).FirstOrDefault(nm => nm.GetType() == typeof(FakeNancyModuleWithBasePath));
var output1 = this.bootstrapper.GetAllModules(context1).FirstOrDefault(nm => nm.GetType() == typeof(FakeNancyModuleWithBasePath));
var output2 = this.bootstrapper.GetAllModules(context2).FirstOrDefault(nm => nm.GetType() == typeof(FakeNancyModuleWithBasePath));

// Then
output1.ShouldNotBeNull();
Expand Down
2 changes: 2 additions & 0 deletions src/Nancy.Bootstrappers.Ninject.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.0.0.4001" targetFramework="net40" />
<package id="Ninject" version="3.0.1.10" />
<package id="Ninject.Extensions.Factory" version="3.0.1.0" targetFramework="net40" />
<package id="xunit" version="1.9.1" targetFramework="net40" />
<package id="xunit.extensions" version="1.9.1" targetFramework="net40" />
</packages>
68 changes: 0 additions & 68 deletions src/Nancy.Bootstrappers.Ninject/FactoryModule.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
<Compile Include="..\..\dependencies\Nancy\src\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="FactoryModule.cs" />
<Compile Include="NinjectNancyBootstrapper.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected override sealed INancyEngine GetEngineInternal()
/// <returns>Container instance</returns>
protected override IKernel GetApplicationContainer()
{
return new StandardKernel(new[] { new FactoryModule() });
return new StandardKernel();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<dependency id="Nancy" />
<dependency id="Ninject" />
<dependency id="Ninject.Extensions.ChildKernel" />
<dependency id="Ninject.Extensions.Factory" />
</dependencies>
<tags>Nancy Ninject</tags>
</metadata>
Expand Down