コード例 #1
0
        public void When_obtaining_details_on_a_message_queue(string queueName, bool exists)
        {
            // Arrange
            if (exists && !MessageQueue.Exists(queueName))
                MessageQueue.Create(queueName);
            else if (!exists && MessageQueue.Exists(queueName))
                MessageQueue.Delete(queueName);

            Thread.Sleep(2000); // Give the queues some time to spin up

            var factory = new MsMqMessageQueueDetailFactory();

            // Act
            var result = factory.Build<TestMessage>(queueName);

            // Assert
            Assert.That(result.Uri,Is.EqualTo(queueName));
            Assert.That(result.Exists,Is.EqualTo(exists));
        } 
コード例 #2
0
        public void When_obtaining_details_on_a_message_queue(string queueName, bool exists)
        {
            // Arrange
            if (exists && !MessageQueue.Exists(queueName))
            {
                MessageQueue.Create(queueName);
            }
            else if (!exists && MessageQueue.Exists(queueName))
            {
                MessageQueue.Delete(queueName);
            }

            Thread.Sleep(2000); // Give the queues some time to spin up

            var factory = new MsMqMessageQueueDetailFactory();

            // Act
            var result = factory.Build <TestMessage>(queueName);

            // Assert
            Assert.That(result.Uri, Is.EqualTo(queueName));
            Assert.That(result.Exists, Is.EqualTo(exists));
        }