public void A_message_queue_uri_should_convert_to_a_queue_path()
 {
     var address = new MsmqEndpointAddress(_uriAddress);
     address.InboundFormatName
         .ShouldEqual(_expectedQueuePath);
     address.Uri
         .ShouldEqual(_expectedUri);
     address.IsLocal
         .ShouldBeTrue();
 }
        public void A_message_queue_address_accept_the_tx_flag_as_a_uri_string()
        {
            var uriAddress = new Uri("msmq://localhost/mt_should_not_exist?tx=true");

            var address = new MsmqEndpointAddress(uriAddress);

            address.InboundFormatName
                .ShouldEqual(_expectedQueuePath);
            address.Uri
                .ShouldEqual(new Uri("msmq://" + Environment.MachineName + "/mt_should_not_exist?tx=true&recoverable=true"));
            address.IsTransactional
                .ShouldBeTrue();
        }
Beispiel #3
0
        public void A_message_queue_address_accept_the_tx_flag_as_a_uri_string()
        {
            var uriAddress = new Uri("msmq://localhost/mt_should_not_exist?tx=true");

            var address = new MsmqEndpointAddress(uriAddress);

            address.InboundFormatName
            .ShouldEqual(_expectedQueuePath);
            address.Uri
            .ShouldEqual(new Uri("msmq://" + Environment.MachineName + "/mt_should_not_exist?tx=true"));
            address.IsTransactional
            .ShouldBeTrue();
        }
Beispiel #4
0
        public void A_message_queue_address_should_not_include_query_string_parameters()
        {
            var uriAddress = new Uri("msmq://localhost/mt_should_not_exist?tx=false");

            var address = new MsmqEndpointAddress(uriAddress);

            address.InboundFormatName
            .ShouldEqual(_expectedQueuePath);
            address.IsTransactional
            .ShouldBeFalse();
            address.Uri
            .ShouldEqual(_expectedUri);
        }
Beispiel #5
0
        public void Local_queue_should_be_transactional_when_identified()
        {
            var address = new MsmqEndpointAddress(new Uri(_address + "?tx=true"));

            address.InboundFormatName
            .ShouldEqual(_expectedQueuePath);
            address.Uri
            .ShouldEqual(new Uri(_expectedUri.ToString().Replace("?tx=false", "?tx=true")));
            address.IsLocal
            .ShouldBeTrue();
            address.IsTransactional
            .ShouldBeTrue();
        }
Beispiel #6
0
        public void Local_queues_should_be_non_transactional_by_default()
        {
            var address = new MsmqEndpointAddress(_uriAddress);

            address.InboundFormatName
            .ShouldEqual(_expectedQueuePath);
            address.Uri
            .ShouldEqual(_expectedUri);
            address.IsLocal
            .ShouldBeTrue();
            address.IsTransactional
            .ShouldBeFalse();
        }
        public void A_message_queue_address_should_not_include_query_string_parameters()
        {
            var uriAddress = new Uri("msmq://localhost/mt_should_not_exist?tx=false");

            var address = new MsmqEndpointAddress(uriAddress);

            address.InboundFormatName
                .ShouldEqual(_expectedQueuePath);
            address.IsTransactional	
                .ShouldBeFalse();
            address.Uri
                .ShouldEqual(_expectedUri);
        }
Beispiel #8
0
        public void A_remote_server_should_keep_the_remote_server_name()
        {
            var          remoteUri       = new Uri("msmq://remote_server/queue_name");
            const string remoteQueuePath = @"FormatName:DIRECT=OS:remote_server\private$\queue_name";

            var address = new MsmqEndpointAddress(remoteUri);

            address.InboundFormatName
            .ShouldEqual(remoteQueuePath);
            address.Uri
            .ShouldEqual(remoteUri);
            address.IsLocal
            .ShouldBeFalse();
        }
        public void Creating_a_queue_with_transactional_enabled()
        {
            _address = new MsmqEndpointAddress(new Uri("msmq://localhost/created_nontransactional"));

            if(MessageQueue.Exists(_address.LocalName))
                MessageQueue.Delete(_address.LocalName);

            _bus = ServiceBusFactory.New(x =>
                {
                    x.UseMsmq();
                    x.ReceiveFrom(_address.Uri);

                    x.SetCreateMissingQueues(true);
                });
        }
Beispiel #10
0
        public void Remote_queue_should_be_non_transactional_when_identified()
        {
            var          remoteUri       = new Uri("msmq://remote_server/queue_name?tx=false");
            const string remoteQueuePath = @"FormatName:DIRECT=OS:remote_server\private$\queue_name";

            var address = new MsmqEndpointAddress(remoteUri);

            address.InboundFormatName
            .ShouldEqual(remoteQueuePath);
            address.Uri
            .ShouldEqual(remoteUri);
            address.IsLocal
            .ShouldBeFalse();
            address.IsTransactional
            .ShouldBeFalse();
        }
        public void Creating_a_queue_with_transactional_enabled()
        {
            _address = new MsmqEndpointAddress(new Uri("msmq://localhost/created_nontransactional"));

            if (MessageQueue.Exists(_address.LocalName))
            {
                MessageQueue.Delete(_address.LocalName);
            }

            _bus = ServiceBusFactory.New(x =>
            {
                x.UseMsmq();
                x.ReceiveFrom(_address.Uri);

                x.SetCreateMissingQueues(true);
            });
        }
Beispiel #12
0
        public void The_resulting_Uri_should_match_the_string()
        {
            var address = new MsmqEndpointAddress(new Uri("msmq://localhost/mt_should_not_exist"));

            Assert.That(address.Uri.AbsoluteUri, Is.EqualTo("msmq://" + Environment.MachineName.ToLowerInvariant() + "/mt_should_not_exist?tx=false&recoverable=true"));
        }
        public void The_result_Uri_should_match_the_constructor_string()
        {
            var address = new MsmqEndpointAddress(new Uri("msmq://localhost/mt_should_not_exist"));

            Assert.That(address.Uri.AbsoluteUri, Is.EqualTo("msmq://" + Environment.MachineName.ToLowerInvariant() + "/mt_should_not_exist?tx=false&recoverable=true"));
            Assert.That(address.InboundFormatName, Is.EqualTo(@"FormatName:DIRECT=OS:localhost\private$\mt_should_not_exist"));
        }
        public void Local_queues_should_be_non_transactional_by_default()
        {
            var address = new MsmqEndpointAddress(_uriAddress);

            address.InboundFormatName
                .ShouldEqual(_expectedQueuePath);
            address.Uri
                .ShouldEqual(_expectedUri);
            address.IsLocal
                .ShouldBeTrue();
            address.IsTransactional
                .ShouldBeFalse();
        }
        public void A_remote_server_should_keep_the_remote_server_name()
        {
            var remoteUri = new Uri("msmq://remote_server/queue_name");
            const string remoteQueuePath = @"FormatName:DIRECT=OS:remote_server\private$\queue_name";

            var address = new MsmqEndpointAddress(remoteUri);
            address.InboundFormatName
                .ShouldEqual(remoteQueuePath);
            address.Uri
                .ShouldEqual(remoteUri);
            address.IsLocal
                .ShouldBeFalse();
        }
        public void Remote_queue_should_be_non_transactional_when_identified()
        {
            var remoteUri = new Uri("msmq://remote_server/queue_name?tx=false");
            const string remoteQueuePath = @"FormatName:DIRECT=OS:remote_server\private$\queue_name";

            var address = new MsmqEndpointAddress(remoteUri);

            address.InboundFormatName
                .ShouldEqual(remoteQueuePath);
            address.Uri
                .ShouldEqual(remoteUri);
            address.IsLocal
                .ShouldBeFalse();
            address.IsTransactional
                .ShouldBeFalse();
        }
        public void Local_queue_should_be_transactional_when_identified()
        {
            var address = new MsmqEndpointAddress(new Uri(_address + "?tx=true"));

            address.InboundFormatName
                .ShouldEqual(_expectedQueuePath);
            address.Uri
                .ShouldEqual(new Uri(_expectedUri.ToString().Replace("?tx=false", "?tx=true")));
            address.IsLocal
                .ShouldBeTrue();
            address.IsTransactional
                .ShouldBeTrue();
        }
        public void The_resulting_Uri_should_match_the_string()
        {
            var address = new MsmqEndpointAddress(new Uri("msmq://localhost/mt_should_not_exist"));

            Assert.That(address.Uri.AbsoluteUri, Is.EqualTo("msmq://" + Environment.MachineName.ToLowerInvariant() + "/mt_should_not_exist?tx=false&recoverable=true"));
        }