public void StrategyDisposesInstanceIfItIsDisposable() { var instance = new NotifiesWhenDisposed(); var reference = new InstanceReference { Instance = instance }; strategy.Deactivate(contextMock.Object, reference); instance.IsDisposed.ShouldBeTrue(); }
public void StrategyDisposesInstanceIfItIsDisposable() { var instance = new NotifiesWhenDisposed(); contextMock.SetupGet(x => x.Instance).Returns(instance); strategy.Deactivate(contextMock.Object); instance.IsDisposed.ShouldBeTrue(); }
public void InstanceIsNotTrackedForDeactivation() { var instance = new NotifiesWhenDisposed(); kernel.Inject(instance); kernel.Dispose(); instance.IsDisposed.Should().BeFalse(); }