public void BuildBaseAndChildObject2() { UnityContainer uc = new UnityContainer(); ChildStub1 objChild = new ChildStub1(); Assert.IsNotNull(objChild); Assert.IsNull(objChild.BaseProp); Assert.IsNull(objChild.ChildProp); uc.BuildUp(typeof(ChildStub1), objChild); Assert.IsNotNull(objChild.BaseProp); Assert.IsNotNull(objChild.ChildProp); //ChildProp get created }
public void BuildBaseAndChildObject1() { UnityContainer uc = new UnityContainer(); ChildStub1 objChild = new ChildStub1(); Assert.IsNotNull(objChild); Assert.IsNull(objChild.BaseProp); Assert.IsNull(objChild.ChildProp); uc.BuildUp(typeof(BaseStub1), objChild); Assert.IsNotNull(objChild.BaseProp); Assert.IsNull(objChild.ChildProp); //the base does not know about child, so it will not build the child property uc.BuildUp(typeof(ChildStub1), objChild); Assert.IsNotNull(objChild.BaseProp); Assert.IsNotNull(objChild.ChildProp); //ChildProp get created uc.BuildUp(typeof(BaseStub1), objChild); Assert.IsNotNull(objChild.BaseProp); Assert.IsNotNull(objChild.ChildProp); //ChildProp is not touched, so it is still NotNull }
public void BuildBaseAndChildObject2() { UnityContainer uc = new UnityContainer(); ChildStub1 objChild = new ChildStub1(); Assert.IsNotNull(objChild); Assert.IsNull(objChild.BaseProp); Assert.IsNull(objChild.ChildProp); uc.BuildUp(typeof(ChildStub1), objChild); Assert.IsNotNull(objChild.BaseProp); Assert.IsNotNull(objChild.ChildProp); //ChildProp get created }
public void BuildBaseAndChildObject1() { UnityContainer uc = new UnityContainer(); ChildStub1 objChild = new ChildStub1(); Assert.IsNotNull(objChild); Assert.IsNull(objChild.BaseProp); Assert.IsNull(objChild.ChildProp); uc.BuildUp(typeof(BaseStub1), objChild); Assert.IsNotNull(objChild.BaseProp); Assert.IsNull(objChild.ChildProp); //the base does not know about child, so it will not build the child property uc.BuildUp(typeof(ChildStub1), objChild); Assert.IsNotNull(objChild.BaseProp); Assert.IsNotNull(objChild.ChildProp); //ChildProp get created uc.BuildUp(typeof(BaseStub1), objChild); Assert.IsNotNull(objChild.BaseProp); Assert.IsNotNull(objChild.ChildProp); //ChildProp is not touched, so it is still NotNull }