Skip to content

Commit

Permalink
Fixes unitycontainer/unity#156
Browse files Browse the repository at this point in the history
  • Loading branch information
ENikS committed Nov 17, 2017
1 parent 3bc6016 commit 937d86a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/Unity.Tests/GitHubIssues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,32 @@ namespace GitHub
public class Issues
{

[TestMethod]
public void unity_156()
{
using (var container = new UnityContainer())
{
var td = new MockLogger();

container.RegisterType<MockLogger>(new ContainerControlledLifetimeManager(), new InjectionFactory(_ => td));
container.RegisterType<ILogger, MockLogger>();

Assert.AreSame(td, container.Resolve<ILogger>());
Assert.AreSame(td, container.Resolve<MockLogger>());
}
using (var container = new UnityContainer())
{
var td = new MockLogger();

container.RegisterType<MockLogger>(new ContainerControlledLifetimeManager(), new InjectionFactory(_ => td));
container.RegisterType<ILogger, MockLogger>();

Assert.AreSame(td, container.Resolve<MockLogger>());
Assert.AreSame(td, container.Resolve<ILogger>());
}
}


[TestMethod]
public void unity_154_5()
{
Expand Down

0 comments on commit 937d86a

Please sign in to comment.