当前位置: 首页>>代码示例>>C#>>正文


C# QueueServiceClient.UpdateMessage方法代码示例

本文整理汇总了C#中QueueServiceClient.UpdateMessage方法的典型用法代码示例。如果您正苦于以下问题:C# QueueServiceClient.UpdateMessage方法的具体用法?C# QueueServiceClient.UpdateMessage怎么用?C# QueueServiceClient.UpdateMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QueueServiceClient的用法示例。


在下文中一共展示了QueueServiceClient.UpdateMessage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateMessage_NonExistentMessage_ThrowsException

        public void UpdateMessage_NonExistentMessage_ThrowsException()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueName = GenerateSampleQueueName();
            _util.CreateQueue(queueName);

            client.UpdateMessage(queueName, "123-abc", FakePopReceipt, 0);

            // expects exception
        }
开发者ID:BrianMcBrayer,项目名称:BasicAzureStorageSDK,代码行数:10,代码来源:MessageOperationsTests.cs

示例2: UpdateMessage_InvalidXMLMessageTextCharacters_DoesNotThrowException

        public void UpdateMessage_InvalidXMLMessageTextCharacters_DoesNotThrowException()
        {
            const string rawFirstText = "<QueueMessage><MessageText>Test</MessageText></QueueMessage>";
            const string rawSecondText = "{\"KeyValueLogPayload\": {\"UserIP\": \"::1\",\"URL\": \"http://fakeurl/foo?bar=baz&baz=bar\"}}";
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueName = GenerateSampleQueueName();
            _util.CreateQueue(queueName);
            _util.AddItemsToQueue(queueName, new List<string>() { rawFirstText });
            var itemFromQueue = _util.GetItemFromQueue(queueName, 1);

            Assert.DoesNotThrow(() =>
            {
                client.UpdateMessage(queueName, itemFromQueue.Id, itemFromQueue.PopReceipt, 0, rawSecondText);
            });
        }
开发者ID:BrianMcBrayer,项目名称:BasicAzureStorageSDK,代码行数:15,代码来源:MessageOperationsTests.cs

示例3: UpdateMessage_DifferentMessageText_ChangesMessageText

        public void UpdateMessage_DifferentMessageText_ChangesMessageText()
        {
            const string rawFirstText = "1";
            const string rawSecondText = "2";
            var firstText = Convert.ToBase64String(Encoding.UTF8.GetBytes(rawFirstText));
            var secondText = Convert.ToBase64String(Encoding.UTF8.GetBytes(rawSecondText));
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueName = GenerateSampleQueueName();
            _util.CreateQueue(queueName);
            _util.AddItemsToQueue(queueName, new List<string>() { firstText });
            var itemFromQueue = _util.GetItemFromQueue(queueName, 1);

            client.UpdateMessage(queueName, itemFromQueue.Id, itemFromQueue.PopReceipt, 0, secondText);

            var itemFromQueueAgain = _util.GetItemFromQueue(queueName);
            Assert.AreEqual(rawSecondText, itemFromQueueAgain.AsString);
        }
开发者ID:BrianMcBrayer,项目名称:BasicAzureStorageSDK,代码行数:17,代码来源:MessageOperationsTests.cs

示例4: UpdateMessage_ExtendVisibility_ExtendsMessageVisibilityInTheQueue

        public void UpdateMessage_ExtendVisibility_ExtendsMessageVisibilityInTheQueue()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueName = GenerateSampleQueueName();
            _util.CreateQueue(queueName);
            _util.AddItemsToQueue(queueName, new List<string>() { "1" });
            var itemFromQueue = _util.GetItemFromQueue(queueName, 1);

            var response = client.UpdateMessage(queueName, itemFromQueue.Id, itemFromQueue.PopReceipt, 30);

            Assert.IsNotNullOrEmpty(response.PopReceipt);
            Thread.Sleep(2000); // longer than the original visibility timeout
            var itemFromQueueAgain = _util.GetItemFromQueue(queueName);
            Assert.IsNull(itemFromQueueAgain);
        }
开发者ID:BrianMcBrayer,项目名称:BasicAzureStorageSDK,代码行数:15,代码来源:MessageOperationsTests.cs

示例5: UpdateMessage_UpdateContent_UpdatesContentOfMessageInQueue

        public void UpdateMessage_UpdateContent_UpdatesContentOfMessageInQueue()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueName = GenerateSampleQueueName();
            _util.CreateQueue(queueName);
            _util.AddItemsToQueue(queueName, new List<string>() { "1" });
            var itemFromQueue = _util.GetItemFromQueue(queueName);
            var newString = Convert.ToBase64String(Encoding.ASCII.GetBytes("2"));   // the official SDK base 64's the values automatically

            client.UpdateMessage(queueName, itemFromQueue.Id, itemFromQueue.PopReceipt, 0, newString);

            var itemFromQueueAgain = _util.GetItemFromQueue(queueName);
            Assert.IsNotNull(itemFromQueueAgain);
            Assert.AreEqual(itemFromQueue.Id, itemFromQueueAgain.Id);
            Assert.AreEqual("1", itemFromQueue.AsString);
            Assert.AreEqual("2", itemFromQueueAgain.AsString);
        }
开发者ID:BrianMcBrayer,项目名称:BasicAzureStorageSDK,代码行数:17,代码来源:MessageOperationsTests.cs

示例6: UpdateMessage_ClearVisibility_AllowsMessageToBeRetrievedAgain

        public void UpdateMessage_ClearVisibility_AllowsMessageToBeRetrievedAgain()
        {
            IQueueServiceClient client = new QueueServiceClient(_accountSettings);
            var queueName = GenerateSampleQueueName();
            _util.CreateQueue(queueName);
            _util.AddItemsToQueue(queueName, new List<string>() { "1" });
            var itemFromQueue = _util.GetItemFromQueue(queueName);

            client.UpdateMessage(queueName, itemFromQueue.Id, itemFromQueue.PopReceipt, 0);

            var itemFromQueueAgain = _util.GetItemFromQueue(queueName);
            Assert.IsNotNull(itemFromQueueAgain);
            Assert.AreEqual(itemFromQueue.Id, itemFromQueueAgain.Id);
        }
开发者ID:BrianMcBrayer,项目名称:BasicAzureStorageSDK,代码行数:14,代码来源:MessageOperationsTests.cs


注:本文中的QueueServiceClient.UpdateMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。