Example #1
0
        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);
            }
        }
Example #2
0
        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);
            }
        }