public void Instance_is_reused_on_same_thread_when_controlled_by_threadsingleton_lifecycle()
{
var builder = new ContainerBuilder();
builder.DefaultControlledBy<ThreadSingletonLifecycle>();
builder.Register<IFoo, Foo>();
builder.Register<IBar, Bar>();
var container = builder.Build();
var threadData = new ThreadData(container);
var thread = new Thread(threadData.ResolveFoosWithContainer);
var threadDataTwo = new ThreadData(container);
var threadTwo = new Thread(threadDataTwo.ResolveFoosWithContainer);
thread.Start();
threadTwo.Start();
thread.Join();
threadTwo.Join();
Assert.IsTrue(ReferenceEquals(threadData.FooOne, threadData.FooTwo));
Assert.IsFalse(ReferenceEquals(threadData.FooOne, threadDataTwo.FooOne));
}