public void format_a_simple_exception() { var exception = new NotImplementedException(); var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); actual.Should().Be(" System.NotImplementedException: The method or operation is not implemented.\r\n"); }
public void format_a_simple_exception() { var exception = new NotImplementedException(); var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); actual.Should().StartWith(" System.NotImplementedException"); }
public void info_without_exception() { var sut = new BaseLoggerWrapper(GetType()); sut.Info("Heloo"); sut.Entries.Count.Should().Be(1); sut.Entries[0].Message.Should().Be("Heloo"); sut.Entries[0].LogLevel.Should().Be(LogLevel.Info); sut.Entries[0].Exception.Should().BeNull(); }
public void debug_with_exception() { var sut = new BaseLoggerWrapper(GetType()); sut.Debug("Heloo", new ExternalException()); sut.Entries.Count.Should().Be(1); sut.Entries[0].Message.Should().Be("Heloo"); sut.Entries[0].LogLevel.Should().Be(LogLevel.Debug); sut.Entries[0].Exception.Should().BeOfType <ExternalException>(); }
public void debug_formatted() { var sut = new BaseLoggerWrapper(GetType()); sut.Debug("Heloo {0}", "World"); sut.Entries.Count.Should().Be(1); sut.Entries[0].Message.Should().Be("Heloo World"); sut.Entries[0].LogLevel.Should().Be(LogLevel.Debug); sut.Entries[0].Exception.Should().BeNull(); }
public void debug_with_exception() { var sut = new BaseLoggerWrapper(GetType()); sut.Debug("Heloo", new ExternalException()); sut.Entries.Count.Should().Be(1); sut.Entries[0].Message.Should().Be("Heloo"); sut.Entries[0].LogLevel.Should().Be(LogLevel.Debug); sut.Entries[0].Exception.Should().BeOfType<ExternalException>(); }
public void trace_without_exception() { var sut = new BaseLoggerWrapper(GetType()); sut.Trace("Heloo"); sut.Entries.Count.Should().Be(1); sut.Entries[0].Message.Should().Be("Heloo"); sut.Entries[0].LogLevel.Should().Be(LogLevel.Trace); sut.Entries[0].Exception.Should().BeNull(); }
public void ignore_null_properties_in_the_exception_output() { var exception = new ExceptionWithProperty2() { UserId = 10 }; var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); actual.Should().Be(" Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty2: Exception of type 'Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty2' was thrown.\r\n [UserId='10']\r\n"); }
public void include_properties_in_the_exception_output() { var exception = new ExceptionWithProperty2() { UserId = 10, FirstName = "Arne" }; var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); actual.Should().StartWith(" Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty2"); actual.Should().EndWith("[UserId='10',FirstName='Arne']\r\n"); }
public void ignore_null_properties_in_the_exception_output() { var exception = new ExceptionWithProperty2() { UserId = 10}; var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); actual.Should().Be(" Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty2: Exception of type 'Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty2' was thrown.\r\n [UserId='10']\r\n"); }
public void include_properties_in_the_exception_output() { var exception = new ExceptionWithProperty2() { UserId = 10, FirstName = "Arne"}; var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); actual.Should().Be(" Griffin.Tests.Logging.Loggers.ExceptionWithProperty2: Exception of type 'Griffin.Tests.Logging.Loggers.ExceptionWithProperty2' was thrown.\r\n [UserId='10',FirstName='Arne']\r\n"); }
public void include_properties_in_the_exception_output() { var exception = new ExceptionWithProperty2() { UserId = 10, FirstName = "Arne"}; var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); actual.Should().StartWith(" Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty2"); actual.Should().EndWith("[UserId='10',FirstName='Arne']\r\n"); }