public void CreateLogger_Category_EnabledByDefault() { // Arrange var fileLogWriter = Mock.Of <FeedbackFileLogWriter>(MockBehavior.Strict); var provider = new FeedbackFileLoggerProvider(fileLogWriter); var categoryName = "Test"; // Act var logger = provider.CreateLogger(categoryName); // Assert Assert.True(logger.IsEnabled(LogLevel.Trace)); provider.Dispose(); }
public void CreateLogger_OmniSharpFrameworkCategory_DisabledByDefault() { // Arrange var fileLogWriter = Mock.Of <FeedbackFileLogWriter>(MockBehavior.Strict); var provider = new FeedbackFileLoggerProvider(fileLogWriter); var categoryName = FeedbackFileLoggerProvider.OmniSharpFrameworkCategoryPrefix + ".Test"; // Act var logger = provider.CreateLogger(categoryName); // Assert Assert.False(logger.IsEnabled(LogLevel.Trace)); provider.Dispose(); }
// Virtual for testing public virtual ILogger CreateLogger(string categoryName) => _loggerProvider.CreateLogger(categoryName);