Path: redb-route/tests/redb.Route.Tests/Processors/LogProcessorTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests/Processors/LogProcessorTests.cs ---- using AwesomeAssertions; using Microsoft.Extensions.Logging; using NSubstitute; using redb.Route.Abstractions; using redb.Route.Core; using redb.Route.Processors; namespace redb.Route.Tests.Processors; /// Tests for . public class LogProcessorTests { /// Static message is logged. [Fact] public async Task Process_StaticMessage_Logged() { var logger = Substitute.For(); var processor = new LogProcessor(logger, "hello route"); await processor.Process(new Exchange()); logger.Received(1).Log( LogLevel.Information, Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any>()); } /// Dynamic message receives the exchange. [Fact] public async Task Process_DynamicMessage_UsesExchange() { var logger = Substitute.For(); var processor = new LogProcessor(logger, ex => $"body={ex.In.Body}"); await processor.Process(new Exchange(new Message("test"))); logger.Received(1).Log( LogLevel.Information, Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any>()); } /// Custom log level is used. [Fact] public async Task Process_CustomLevel_Used() { var logger = Substitute.For(); var processor = new LogProcessor(logger, "warn!", LogLevel.Warning); await processor.Process(new Exchange()); logger.Received(1).Log( LogLevel.Warning, Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any>()); } /// Null logger throws. [Fact] public void Constructor_NullLogger_Throws() { var act = () => new LogProcessor(null!, "msg"); act.Should().Throw(); } /// Null message func throws. [Fact] public void Constructor_NullMessageFunc_Throws() { var logger = Substitute.For(); var act = () => new LogProcessor(logger, (Func)null!); act.Should().Throw(); } }