示例#1
0
        public void a_normal_address_and_its_topic_corresponding_address()
        {
            _queueAddress = AzureServiceBusEndpointAddressImpl.Parse(
                TestDataFactory.ApplicationEndpoint);

            var formatter = new AzureMessageNameFormatter();

            _topicName = formatter.GetMessageName(typeof(A)).ToString();

            _topicAddress = _queueAddress.ForTopic(_topicName);

            Assert.Throws <ArgumentNullException>(
                () => _queueAddress.ForTopic(null));
        }
        /// <summary>
        /// Adds an endpoint for the message type. This will look up all super-classes
        /// of the message's type (running for those as well) and then create
        /// message sinks corresponding to the type of message that is being published.
        /// </summary>
        /// <param name="messageType">The type of message to add an endpoint for.</param>
        void AddEndpointForType(Type messageType)
        {
            using (var management = new AzureManagementEndpointManagement(_address))
            {
                var types = management.CreateTopicsForPublisher(messageType, _formatter);

                foreach (var type in types)
                {
                    if (_added.ContainsKey(type))
                    {
                        continue;
                    }

                    var messageName = _formatter.GetMessageName(type);

                    var messageEndpointAddress = _address.ForTopic(messageName.ToString());

                    FindOrAddEndpoint(type, messageEndpointAddress);
                }
            }
        }
		public void a_normal_address_and_its_topic_corresponding_address()
		{
			_queueAddress = AzureServiceBusEndpointAddressImpl.Parse(
				TestDataFactory.ApplicationEndpoint);

			var formatter = new AzureMessageNameFormatter();
			_topicName = formatter.GetMessageName(typeof (A)).ToString();

			_topicAddress = _queueAddress.ForTopic(_topicName);

			Assert.Throws<ArgumentNullException>(
				() => _queueAddress.ForTopic(null));
		}