Path: redb-route/tests/redb.Route.Tests.RabbitMQ/RabbitMQEndpointTests.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.RabbitMQ/RabbitMQEndpointTests.cs ---- using redb.Route.Abstractions; using redb.Route.Core; using redb.Route.RabbitMQ; namespace redb.Route.Tests.RabbitMQ; public sealed class RabbitMQEndpointTests { private readonly RabbitMQComponent _component = new(); private RabbitMQEndpoint CreateEndpoint(string uriStr) { var uri = EndpointUriParser.Parse(uriStr); return (RabbitMQEndpoint)_component.CreateEndpoint(uri); } [Fact] public void QueueName_ExtractedFromPath() { var ep = CreateEndpoint("rabbitmq://my-queue?host=localhost"); ep.QueueName.Should().Be("my-queue"); } [Fact] public void CreateProducer_ReturnsRabbitMQProducer() { var ep = CreateEndpoint("rabbitmq://q?host=localhost"); var producer = ep.CreateProducer(); producer.Should().BeOfType(); } [Fact] public void CreateConsumer_ReturnsRabbitMQConsumer() { var ep = CreateEndpoint("rabbitmq://q?host=localhost"); var processor = Substitute.For(); var consumer = ep.CreateConsumer(processor); consumer.Should().BeOfType(); } [Fact] public void Component_IsRabbitMQComponent() { var ep = CreateEndpoint("rabbitmq://q?host=localhost"); ep.Component.Should().BeSameAs(_component); } [Fact] public void Uri_PreservesOriginal() { var ep = CreateEndpoint("rabbitmq://my-queue?host=rabbit1"); ep.Uri.Scheme.Should().Be("rabbitmq"); ep.Uri.Path.Should().Be("my-queue"); } [Theory] [InlineData("amq.gen-JzTY20BRgKO-HjmUJj0wLg", true)] [InlineData("amq.rabbitmq.reply-to.g1h2AA5yZXBseUAxMzA0MDI0NQAAAAAA", true)] [InlineData("amq.rabbitmq.reply-to", true)] [InlineData("orders", false)] [InlineData("", false)] [InlineData(null, false)] public void A_late_reply_to_a_gone_client_is_a_transient_return(string? routingKey, bool transient) { RabbitMQEndpoint.IsTransientReplyTo(routingKey).Should().Be(transient); } }