Skip to content

Latest commit

 

History

History
87 lines (64 loc) · 2.81 KB

File metadata and controls

87 lines (64 loc) · 2.81 KB

Verify.ZeroLog

Discussions Build status NuGet Status

Extends Verify to allow verification of ZeroLog bits.

See Milestones for release notes.

Sponsors

Entity Framework Extensions

Entity Framework Extensions is a major sponsor and is proud to contribute to the development this project.

Entity Framework Extensions

Developed using JetBrains IDEs

JetBrains logo.

NuGet

Usage

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

snippet source | anchor

[Fact]
public Task Usage()
{
    Recording.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,
  log: [
    {
      Error: The error,
      Logger: Tests
    },
    {
      Warn: The warning,
      Logger: Tests
    }
  ]
}

snippet source | anchor