public void DisposingOfParentContainerDisposesChildAndParentObject() { var o1 = container.Resolve <DisposableObject>(); var o2 = child.Resolve <DisposableObject>(); container.Dispose(); Assert.IsTrue(o1.WasDisposed); Assert.IsTrue(o2.WasDisposed); }
public void DisposingOfChildContainerDisposesOnlyChildObject() { var o1 = container.Resolve <DisposableObject>(); var o2 = child.Resolve <DisposableObject>(); child.Dispose(); Assert.IsFalse(o1.WasDisposed); Assert.IsTrue(o2.WasDisposed); }