Esempio n. 1
0
        public void Queue_IfBoundToCloudQueue_BindsAndCreatesQueue()
        {
            // Arrange
            IStorageAccount     account      = CreateFakeStorageAccount();
            IStorageQueueClient client       = account.CreateQueueClient();
            IStorageQueue       triggerQueue = CreateQueue(client, TriggerQueueName);

            triggerQueue.AddMessage(triggerQueue.CreateMessage("ignore"));

            // Act
            CloudQueue result = RunTrigger <CloudQueue>(account, typeof(BindToCloudQueueProgram),
                                                        (s) => BindToCloudQueueProgram.TaskSource = s);

            // Assert
            Assert.NotNull(result);
            Assert.Equal(QueueName, result.Name);
            IStorageQueue queue = client.GetQueueReference(QueueName);

            Assert.True(queue.Exists());
        }