Skip to content

Commit

Permalink
Added failing unit test for #718 (skipped) for later testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
tillig committed Aug 16, 2018
1 parent 2fd1ae0 commit 3726ea3
Showing 1 changed file with 28 additions and 0 deletions.
Expand Up @@ -43,5 +43,33 @@ public void WhenLazyIsResolved_ValueIsNotYetCreated()
var lazy = container.Resolve<Lazy<object>>();
Assert.False(lazy.IsValueCreated);
}

[Fact(Skip = "#718")]
public void LazyWorksWithCircularPropertyDependencies()
{
var builder = new ContainerBuilder();

builder.RegisterType<A>()
.SingleInstance();
builder.RegisterType<B>()
.SingleInstance()
.PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies);

var container = builder.Build();
Assert.NotNull(container.Resolve<A>());
}

private class A
{
public A(Lazy<B> b)
{
var myB = b.Value;
}
}

private class B
{
public A A { get; set; }
}
}
}

0 comments on commit 3726ea3

Please sign in to comment.