Path: redb-route/tests/redb.Route.Tests.Redis/RedisEndpointOptionsTests.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.Redis/RedisEndpointOptionsTests.cs ---- using redb.Route.Core; using redb.Route.Redis; namespace redb.Route.Tests.Redis; public sealed class RedisEndpointOptionsTests { [Fact] public void Defaults_AreReasonable() { var opts = new RedisEndpointOptions(); opts.ConnectionString.Should().Be("localhost:6379"); opts.Database.Should().Be(0); opts.Password.Should().BeNull(); opts.Key.Should().BeNull(); opts.Channel.Should().BeNull(); opts.StreamName.Should().BeNull(); opts.ConsumerGroup.Should().BeNull(); opts.ConsumerName.Should().BeNull(); opts.UsePattern.Should().BeFalse(); opts.Ttl.Should().Be(0); opts.Score.Should().BeNull(); opts.Field.Should().BeNull(); opts.GeoUnit.Should().Be("m"); opts.StreamMaxLength.Should().Be(0); opts.StreamApproximate.Should().BeTrue(); opts.StreamReadCount.Should().Be(10); opts.StreamBlockTimeMs.Should().Be(1000); opts.AckMode.Should().Be(AckMode.Manual, "a group consumer acknowledges after its route"); opts.StreamStartPosition.Should().BeNull("unset: the entries added from now on"); opts.Transacted.Should().BeNull("unset, PUBLISH and XADD follow the enclosing .Transacted() block"); opts.PollDelayMs.Should().Be(1000); } [Fact] public void Validate_InvalidStreamReadCount_Throws() { var opts = new RedisEndpointOptions { StreamReadCount = 0 }; var act = () => opts.Validate(); act.Should().Throw().WithMessage("*StreamReadCount*"); } [Fact] public void Validate_NegativeStreamReadCount_Throws() { var opts = new RedisEndpointOptions { StreamReadCount = -1 }; var act = () => opts.Validate(); act.Should().Throw(); } [Fact] public void Validate_ValidOptions_DoesNotThrow() { var opts = new RedisEndpointOptions { StreamReadCount = 100 }; var act = () => opts.Validate(); act.Should().NotThrow(); } }