public void WhenRemovingDisposableValues_ThenDisposeInvoked()
        {
            var valueMock = new Mock<IDisposable>();
            valueMock.Setup(x => x.Dispose()).Verifiable();

            var storeMock = new Mock<IPerRequestStore>();
            storeMock.Setup(s => s.GetValue(It.IsAny<object>())).Returns(valueMock.Object);
            storeMock.Setup(s => s.RemoveValue(It.IsAny<object>())).Verifiable();

            var lifetimeManager = new UnityPerRequestLifetimeManager(storeMock.Object);

            lifetimeManager.SetValue(valueMock.Object);
            lifetimeManager.RemoveValue();

            valueMock.Verify();
        }
        public void WhenValueRemoved_ThenRemovedFromContext()
        {
            var newValue = new object();
            var storeMock = new Mock<IPerRequestStore>();
            storeMock.Setup(s => s.GetValue(It.IsAny<object>())).Returns(newValue);
            storeMock.Setup(s => s.RemoveValue(It.IsAny<object>())).Verifiable();

            var lifetimeManager = new UnityPerRequestLifetimeManager(storeMock.Object);

            lifetimeManager.SetValue(newValue);
            lifetimeManager.RemoveValue();

            storeMock.Verify();
        }