예제 #1
0
        public static void main()
        {
            SQSConsumer sqsConsumer = new SQSConsumer();

            sqsConsumer.Init();
            sqsConsumer.ConsumeMessages();
        }
 public void TestSQSSNS()
 {
     try
     {
         Init();
         queueUrl = GetQueueUrl();
         int initialNumMessages = GetNumberOfMessages();
         SNSPublisher.Main();
         int numAfterSnsPublisher = GetNumberOfMessages();
         SQSConsumer.main();
         int numAfterSQSConsumer = GetNumberOfMessages();
         Debug.WriteLine("SqsSnsTest: initialNumMessages: {0}, numAfterSNSPublisher: {1}, numAfterSQSConsumer: {2}", initialNumMessages, numAfterSnsPublisher, numAfterSQSConsumer);
         if ((numAfterSnsPublisher < initialNumMessages) || (numAfterSQSConsumer > numAfterSnsPublisher))
         {
             Assert.Fail("SqsSnsTest failed. Number of messages in queue not as expected.");
         }
     }
     catch (Exception)
     {
         throw;
     }
     Debug.WriteLine("SqsSnsTest passed.");
 }