public void BuildUpClassWithNestedClassDependencyProperty_Success() { var c = new Container(); c.RegisterType<EmptyClass>().AsSingleton(); c.RegisterType<SampleClassWithClassDependencyProperty>(); var sampleClass = new SampleClassWithNestedClassDependencyProperty(); c.BuildUp(sampleClass, ResolveKind.PartialEmitFunction); Assert.IsNotNull(sampleClass.SampleClassWithClassDependencyProperty); Assert.IsNotNull(sampleClass.SampleClassWithClassDependencyProperty.EmptyClass); }
public void DifferentObjects_BuildUpClassWithNestedClassDependencyProperty_Success() { var c = new Container(); c.RegisterType<EmptyClass>().AsSingleton(); c.RegisterType<SampleClassWithClassDependencyProperty>(); var sampleClass1 = new SampleClassWithNestedClassDependencyProperty(); var sampleClass2 = new SampleClassWithNestedClassDependencyProperty(); c.BuildUp(sampleClass1, ResolveKind.PartialEmitFunction); c.BuildUp(sampleClass2, ResolveKind.PartialEmitFunction); Assert.IsNotNull(sampleClass1.SampleClassWithClassDependencyProperty); Assert.IsNotNull(sampleClass1.SampleClassWithClassDependencyProperty.EmptyClass); Assert.IsNotNull(sampleClass2.SampleClassWithClassDependencyProperty); Assert.IsNotNull(sampleClass2.SampleClassWithClassDependencyProperty.EmptyClass); Assert.AreNotEqual(sampleClass1, sampleClass2); Assert.AreNotEqual(sampleClass1.SampleClassWithClassDependencyProperty, sampleClass2.SampleClassWithClassDependencyProperty); Assert.AreEqual(sampleClass1.SampleClassWithClassDependencyProperty.EmptyClass, sampleClass2.SampleClassWithClassDependencyProperty.EmptyClass); }