コード例 #1
0
        public void WhenDisposeIsTrueProvidedLoggerIsDisposed()
        {
            var logger   = new DisposeTrackingLogger();
            var provider = new SerilogLoggerProvider(logger, true);

            provider.Dispose();
            Assert.True(logger.IsDisposed);
        }
コード例 #2
0
        public void WhenDisposeIsFalseProvidedLoggerIsNotDisposed()
        {
            var logger   = new DisposeTrackingLogger();
            var provider = new SerilogLoggerProvider(logger, false);

            provider.Dispose();
            Assert.False(logger.IsDisposed);
        }
コード例 #3
0
        public void WhenDisposeIsTrueProvidedLoggerIsDisposed()
        {
#pragma warning disable CA2000 // Dispose objects before losing scope
            var logger = new DisposeTrackingLogger();
#pragma warning restore CA2000 // Dispose objects before losing scope
            var provider = new SerilogLoggerProvider(logger, true);
            provider.Dispose();
            Assert.True(logger.IsDisposed);
        }
コード例 #4
0
 /// <summary>
 /// Disposes the provider.
 /// </summary>
 public void Dispose()
 {
     _provider.Dispose();
 }
コード例 #5
0
 public void Dispose()
 {
     _serilogLoggerProvider.Dispose();
 }
コード例 #6
0
 public void Dispose() => _provider.Dispose();