public void Debug_LambdaMessage() { // Prepare const string message = "Simple Message"; logger.Setup(l => l.Write( LogEventLevel.Debug, message, null)) .Verifiable(); log = new SerilogLogger(logger.Object); // Act log.Debug(message); // Assert logger.VerifyAll(); }
public void Debug_MessageWithException() { // Prepare const string message = "Exception occurred"; var ex = new Exception(message); logger.Setup(l => l.Write( LogEventLevel.Debug,ex, message, null)) .Verifiable(); log = new SerilogLogger(logger.Object); // Act log.Debug(message,ex); // Assert logger.VerifyAll(); }
public void Debug_FormatMessage() { // Prepare const string format = "Number of Call: {0} occurred"; logger.Setup(l => l.Write( LogEventLevel.Debug, format, 1)) .Verifiable(); log = new SerilogLogger(logger.Object); // Act log.DebugFormat(format, 1); // Assert logger.VerifyAll(); }
public void Warn_MessageOnly() { // Prepare const string message = "Simple Message"; logger.Setup(l => l.Write( LogEventLevel.Warning, message, null)) .Verifiable(); log = new SerilogLogger(logger.Object); // Act log.Warn(message); // Assert logger.VerifyAll(); }
public void TearDown() { logger = null; log = null; }