public void Create_Dead_Letter_Message_Receiver_With_Expected_NonDefault_Properties()
        {
            var config = new MyEndpointHandlingConfig
            {
                ConnectionString            = "Endpoint=sb://your-sb.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=",
                EntityPath                  = "unittests.singlemessagetype/Subscriptions/MessageReceiverFactoryShould",
                MaxConcurrentCalls          = 2,
                MaxAutoRenewDurationSeconds = 60,
                AutoComplete                = true,
            };

            var expectedServiceBusEndpoint = "sb://your-sb.windows.net/";
            var expectedDeadLetterPath     = EntityNameHelper.FormatDeadLetterPath(config.EntityPath);
            var expectedReceiveMode        = ReceiveMode.ReceiveAndDelete;
            var expectedRetryPolicy        = new NoRetry();
            var expectedPrefetchCount      = 1;

            var messageReceiver = _messageReceiverFactory.CreateDeadLetterMessageReceiver(config, expectedReceiveMode, expectedRetryPolicy, expectedPrefetchCount);

            (messageReceiver as MessageReceiver).ServiceBusConnection.Endpoint.Should().Be(expectedServiceBusEndpoint);
            (messageReceiver as MessageReceiver).Path.Should().Be(expectedDeadLetterPath);
            (messageReceiver as MessageReceiver).ReceiveMode.Should().Be(expectedReceiveMode);
            (messageReceiver as MessageReceiver).RetryPolicy.Should().Be(expectedRetryPolicy);
            (messageReceiver as MessageReceiver).PrefetchCount.Should().Be(expectedPrefetchCount);
        }
        public void Create_New_Message_Receivers_Regardless_Of_Having_The_Same_Config()
        {
            var sameConfig = new MyEndpointHandlingConfig
            {
                ConnectionString =
                    "Endpoint=sb://your-sb.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=",
                EntityPath                  = "unittests.singlemessagetype/Subscriptions/MessageReceiverFactoryShould",
                MaxConcurrentCalls          = 2,
                MaxAutoRenewDurationSeconds = 60,
                AutoComplete                = true,
            };

            var messageReceiver        = _messageReceiverFactory.CreateMessageReceiver(sameConfig);
            var anotherMessageReceiver = _messageReceiverFactory.CreateMessageReceiver(sameConfig);

            messageReceiver.Should().NotBeNull();
            anotherMessageReceiver.Should().NotBeNull();
            messageReceiver.Should().NotBeSameAs(anotherMessageReceiver);
        }