예제 #1
0
        public void NullLifetimeScopeIsAllowed()
        {
            var functionBase = new WebJobFunctionBase(null);

            Action actionUnderTest = () => functionBase.Dispose();

            actionUnderTest.ShouldNotThrow("because a null lifetime scope should not be attempted to be disposed");
        }
예제 #2
0
        public void LifetimeScopeIsDisposedWhenTheClassIsDisposed()
        {
            var mockLifetimeScope = new Mock <IDisposable>();
            var functionBase      = new WebJobFunctionBase(mockLifetimeScope.Object);

            functionBase.Dispose();

            mockLifetimeScope.Verify(scope => scope.Dispose(), Times.AtLeastOnce, "The lifetime scope should have been disposed when the class was disposed");
        }