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"); }
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"); }