public void PurgeQueueTest() { QueueMessageBatchTest (); AWSSQSHelper queueTestAWSSQS = new AWSSQSHelper (queueName, 10, regionEndPoint, myAccessKey, mySecretKey); queueTestAWSSQS.PurgeQueue (); }
public void GetQueueMessagesBatchTest() { AWSSQSHelper queueTestAWSSQS = new AWSSQSHelper (queueName, 10, regionEndPoint, myAccessKey, mySecretKey); // Requesting messages queueTestAWSSQS.DeQueueMessages (); // Asserting they are the right ones int tamp = 1; foreach (var msg in queueTestAWSSQS.GetMessages ()) { string msgbody = "This is message number " + tamp + " ! "; Assert.True (msg.Equals (msgbody)); tamp += 1; //Deleting messages queueTestAWSSQS.DeleteMessage (msg); } }
public void QueueMessageBatchTest() { // Creating my messages list IList<string> messages = new List<string> (); for (int ind = 1; ind <= 10; ind++) { string body = "This is message number " + ind + " ! "; messages.Add (body); } // Accessing the queue AWSSQSHelper queueTestAWSSQS = new AWSSQSHelper (queueName, 10, regionEndPoint, myAccessKey, mySecretKey); // Adding messages Assert.True (queueTestAWSSQS.EnqueueMessages (messages)); }
public void QueueMessageTest() { String msgbody = "First test To Queue"; // Accessing the Queue AWSSQSHelper queueTestAWSSQS = new AWSSQSHelper (queueName, 2, regionEndPoint, myAccessKey, mySecretKey); // Adding msgs Assert.True (queueTestAWSSQS.EnqueueMessage (msgbody)); // Request messages queueTestAWSSQS.DeQueueMessages (); // Have i receved any ? Assert.True (queueTestAWSSQS.AnyMessageReceived ()); // Asserting they are the right one foreach (var msg in queueTestAWSSQS.GetMessages ()) { Assert.True (msg.Equals (msgbody)); queueTestAWSSQS.DeleteMessage (msg); } }