public void ResolveClassWithCycleInConstructorWithClassDependencyPropertyAfterBuildUpObjectOfThisClass_Failed()
        {
            var c = new Container();
            c.RegisterType<EmptyClass>().AsSingleton();
            c.RegisterType<SampleClassWithCycleInConstructorWithClassDependencyProperty>();
            var sampleClass1 = new SampleClassWithCycleInConstructorWithClassDependencyProperty(null);

            c.BuildUp(sampleClass1, ResolveKind.PartialEmitFunction);
            var sampleClass2 = c.Resolve<SampleClassWithCycleInConstructorWithClassDependencyProperty>(ResolveKind.PartialEmitFunction);

            Assert.IsNotNull(sampleClass1);
            Assert.IsNotNull(sampleClass1.EmptyClass);
            Assert.IsNull(sampleClass2);
        }
        public void ResolveClassWithCycleInConstructorWithClassDependencyPropertyAfterBuildUpObjectOfThisClass_Failed()
        {
            var c = new Container();
            c.RegisterType<EmptyClass>().AsPerThread();
            c.RegisterType<SampleClassWithCycleInConstructorWithClassDependencyProperty>();
            var sampleClass1 = new SampleClassWithCycleInConstructorWithClassDependencyProperty(null);
            SampleClassWithCycleInConstructorWithClassDependencyProperty sampleClass2 = null;
            Exception exception = null;

            var thread = new Thread(() =>
            {
                try
                {
                    c.BuildUp(sampleClass1, ResolveKind.PartialEmitFunction);
                    sampleClass2 = c.Resolve<SampleClassWithCycleInConstructorWithClassDependencyProperty>(ResolveKind.PartialEmitFunction);
                }
                catch (Exception ex)
                {
                    exception = ex;
                }
            });
            thread.Start();
            thread.Join();

            if (exception != null)
            {
                throw exception;
            }

            Assert.IsNotNull(sampleClass1);
            Assert.IsNotNull(sampleClass1.EmptyClass);
            Assert.IsNull(sampleClass2);
        }
 public SampleClassWithCycleInConstructorWithClassDependencyProperty(SampleClassWithCycleInConstructorWithClassDependencyProperty sampleClass)
 {
 }