public void ShouldDisposeEndpointIfWrappedInLoggingProxy() { IServiceEndpoint endpoint = A.Fake <IServiceEndpoint>(); IServiceEndpoint loggingProxy = new ServiceEndpointLoggingProxy(A.Fake <ILoggerFactory>(), endpoint, message => LogLevel.Info, message => LogLevel.Info); loggingProxy.Dispose(); A.CallTo(() => endpoint.Dispose()).MustHaveHappened(1, Times.Exactly); }
public void ShouldDisposeEndpointIfWrappedInLoggingProxy() { IServiceEndpoint endpoint = A.Fake<IServiceEndpoint>(); IServiceEndpoint loggingProxy = new ServiceEndpointLoggingProxy(A.Fake<ILoggerFactory>(), endpoint, message => LogLevel.Info, message => LogLevel.Info); loggingProxy.Dispose(); A.CallTo(() => endpoint.Dispose()).MustHaveHappened(Repeated.Exactly.Once); }