Exemplo n.º 1
0
        public void Disposed_ThenIsClosed()
        {
            var client = new Mock <IQueueClient>();
            AzureCommandQueue queue = new AzureCommandQueue(client.Object);

            queue.Dispose();

            client.Verify(c => c.Close(), Times.Once());
        }
Exemplo n.º 2
0
        public static void EnableAzureMessageQueuing(this ProcessorConfiguration configuration, string connectionString, int runnerCount)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            AzureCommandQueue azureQueue = null;

            try
            {
                azureQueue = new AzureCommandQueue(connectionString);
                configuration.EnableMessageQueuing(runnerCount, azureQueue, azureQueue);
                azureQueue = null;
            }
            finally
            {
                if (azureQueue != null)
                {
                    azureQueue.Dispose();
                }
            }
        }