Skip to content

Commit

Permalink
Added failing test for issue autofac#608
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-g committed Dec 23, 2014
1 parent 7b90f4c commit 23b2596
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Core/Tests/Autofac.Tests/Core/Lifetime/LifetimeScopeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,24 @@ public void NestedLifetimeScopesGetDisposedWhenParentIsDisposed()
Assert.IsTrue(tracker.IsDisposed, "The tracker should have been disposed along with the lifetime scope chain.");
}


[Test]
[Ignore("Issue #608")]
public void NestedLifetimeScope_ReflectsParentScopeUpdates()
{
var container = new ContainerBuilder().Build();
var nested = container.BeginLifetimeScope(_ => { }); // to create child registry
Assert.That(nested.Resolve<IEnumerable<string>>(), Is.Empty); // required to initialize service info

var builder = new ContainerBuilder();
builder.RegisterInstance("s1");
builder.Update(container);

Assert.That(container.Resolve<string>(), Is.EqualTo("s1"));
Assert.That(nested.Resolve<string>(), Is.EqualTo("s1"), "Nested scope should get update from the parent scope");
}


public class Person
{
}
Expand Down

0 comments on commit 23b2596

Please sign in to comment.