/Verify.ZeroLog

Primary LanguageC#MIT LicenseMIT

Verify.ZeroLog

Build status NuGet Status

Extends Verify to allow verification of ZeroLog bits.

NuGet package

https://nuget.org/packages/Verify.ZeroLog/

Usage

[ModuleInitializer]
public static void Initialize() =>
    VerifyZeroLog.Initialize();

snippet source | anchor

[Fact]
public Task Usage()
{
    RecordingLogger.Start();
    var result = Method();

    return Verify(result);
}

static string Method()
{
    var logger = LogManager.GetLogger<Tests>();
    logger.Error("The error");
    logger.Warn("The warning");
    return "Result";
}

snippet source | anchor

Results in:

{
  target: Result,
  logs: [
    {
      Error: The error,
      Logger: Tests
    },
    {
      Warn: The warning,
      Logger: Tests
    }
  ]
}

snippet source | anchor