public void BuildUnmatchedObject2() { BuildUnmatchedObject2__PropertyDependencyClassStub2 obj2 = new BuildUnmatchedObject2__PropertyDependencyClassStub2(); Assert.IsNotNull(obj2); Assert.IsNull(obj2.MyFirstObj); Assert.IsNull(obj2.MySecondObj); // "type of the object should match" var instance = Container.BuildUp(typeof(BuildUnmatchedObject2_PropertyDependencyClassStub1), obj2); }
public void BuildUnmatchedObject2() { UnityContainer uc = new UnityContainer(); BuildUnmatchedObject2__PropertyDependencyClassStub2 obj2 = new BuildUnmatchedObject2__PropertyDependencyClassStub2(); Assert.IsNotNull(obj2); Assert.IsNull(obj2.MyFirstObj); Assert.IsNull(obj2.MySecondObj); AssertHelper.ThrowsException <ArgumentException>(() => uc.BuildUp(typeof(BuildUnmatchedObject2_PropertyDependencyClassStub1), obj2), "type of the object should match"); }
public void BuildUnmatchedObject2() { UnityContainer uc = new UnityContainer(); BuildUnmatchedObject2__PropertyDependencyClassStub2 obj2 = new BuildUnmatchedObject2__PropertyDependencyClassStub2(); Assert.IsNotNull(obj2); Assert.IsNull(obj2.MyFirstObj); Assert.IsNull(obj2.MySecondObj); AssertHelper.ThrowsException<ArgumentException>(() => uc.BuildUp(typeof(BuildUnmatchedObject2_PropertyDependencyClassStub1), obj2), "type of the object should match"); }