public void PutMessage_TooLargeMessage_ThrowsRequestBodyTooLargeException() { IQueueServiceClient client = new QueueServiceClient(_accountSettings); var queueName = GenerateSampleQueueName(); _util.CreateQueue(queueName); string message = new String('a', 64 * 1024 + 1); client.PutMessage(queueName, message); //expects exception }
public void PutMessage_ValidMessage_AddsMessageToQueue() { IQueueServiceClient client = new QueueServiceClient(_accountSettings); var queueName = GenerateSampleQueueName(); _util.CreateQueue(queueName); string message = "Unit Test Message"; client.PutMessage(queueName, message); _util.AssertQueueHasMessage(queueName); }
public void PutMessage_InvalidXMLCharacters_DoesNotThrowException() { IQueueServiceClient client = new QueueServiceClient(_accountSettings); var queueName = GenerateSampleQueueName(); _util.CreateQueue(queueName); string message = "{\"KeyValueLogPayload\": {\"UserIP\": \"::1\",\"URL\": \"http://fakeurl/foo?bar=baz&baz=bar\"}}"; Assert.DoesNotThrow(() => { client.PutMessage(queueName, message); }); }
public void PutMessage_ValidMessageWithVisibilityTimeout_IsNotVisibleInQueue() { IQueueServiceClient client = new QueueServiceClient(_accountSettings); var queueName = GenerateSampleQueueName(); _util.CreateQueue(queueName); string message = "Unit Test Message"; client.PutMessage(queueName, message, visibilityTimeout: 5); _util.AssertQueueInvisibleMessage(queueName); }
public void PutMessage_ValidMessageWithTTL_DisappearsAfterTTLExpires() { IQueueServiceClient client = new QueueServiceClient(_accountSettings); var queueName = GenerateSampleQueueName(); _util.CreateQueue(queueName); string message = "Unit Test Message"; client.PutMessage(queueName, message, messageTtl: 1); _util.AssertQueueHasMessage(queueName); Thread.Sleep(3100); // a little extra to be sure _util.AssertQueueIsEmpty(queueName); }