Show / Hide Table of Contents

BlazorFocused.Testing.Logging Guide

Tools for verifying logs during Tests

Installation

dotnet add package BlazorFocused.Testing.Logging

Quick Start

private readonly ITestLogger<TestService> testLogger;
private readonly ITestService testService;

public TestServiceTests()
{
    testLogger = ToolsBuilder.CreateTestLogger<TestService>();

    testService =
        new TestService(testLogger);
}

[Fact]
public async Task ShouldLogError()
{
    testService.GeneralMethodWithError();

    testLogger.VerifyWasCalledWith(LogLevel.Error)
}
  • Improve this Doc
In This Article
Back to top Generated by DocFX