Beispiel #1
0
        public void ReturnsProperRetryDestinationFromErrorWhenUserSuppliedIsWhitespace()
        {
            //arrange
            var rawMessage = MessageTestHelpers.GetErrorMessage();

            var destinationFinder = new DetermineRetryDestinationService();

            //act
            var destination = destinationFinder.GetRetryDestination(rawMessage, "\t\t");

            //assert
            destination.Should().Be("Autobahn.Configuration.Host");
        }
Beispiel #2
0
        public void CanGetProperRetryDestinationFromError()
        {
            //arrange
            var rawMessage = MessageTestHelpers.GetErrorMessage();

            var destinationFinder = new DetermineRetryDestinationService();

            //act
            var destination = destinationFinder.GetRetryDestination(rawMessage, null);

            //assert
            destination.Should().Be("Autobahn.Configuration.Host");
        }
Beispiel #3
0
        public void ReturnsWholeQueueWhenDelimiterNotPresent()
        {
            //arrange
            var rawMessage = MessageTestHelpers.GetErrorMessage();

            rawMessage.Headers["NServiceBus.FailedQ"] = "simpleQueue";

            var destinationFinder = new DetermineRetryDestinationService();

            //act
            var destination = destinationFinder.GetRetryDestination(rawMessage, null);

            //assert
            destination.Should().Be("simpleQueue");
        }
Beispiel #4
0
        public void ReturnsNullIfFailedQHeaderNotPresent()
        {
            //arrange
            var rawMessage = MessageTestHelpers.GetErrorMessage();

            rawMessage.Headers.Remove("NServiceBus.FailedQ");

            var destinationFinder = new DetermineRetryDestinationService();

            //act
            var destination = destinationFinder.GetRetryDestination(rawMessage, null);

            //assert
            destination.Should().BeNull();
        }
Beispiel #5
0
        //test
        public void ReturnsUserSuppliedValueWhenNotNullOrWhitespace()
        {
            //arrange
            string userSupplied = "userQueue";
            var    rawMessage   = MessageTestHelpers.GetErrorMessage();

            rawMessage.Headers.Remove("NServiceBus.FailedQ");

            var destinationFinder = new DetermineRetryDestinationService();

            //act
            var destination = destinationFinder.GetRetryDestination(rawMessage, userSupplied);

            //assert
            destination.Should().Be(userSupplied);
        }