コード例 #1
0
 public void SendMessage()
 {
     var sqs = new NAV.AWS.SQS.Service(AWS.Credentials);
     var queue = _localTestContext.Properties["Queue"] as NAV.AWS.SQS.Queue;
     Assert.IsNotNull(queue);
     var message = new Message(queue) { Body = "Test Message", DelaySeconds = 0 };
     sqs.SendMessage(message);
     Assert.IsTrue(!string.IsNullOrWhiteSpace(message.AwsAssignedId));
     Console.Out.WriteLine("Message: {0}", message.AwsAssignedId);
 }
コード例 #2
0
 public void CreateQueue()
 {
     var sqs = new NAV.AWS.SQS.Service(AWS.Credentials);
     var queue = sqs.CreateQueue(_localTestContext.Properties["QueueName"].ToString());
     Assert.IsTrue(!sqs.ErrorExists, sqs.ErrorMessage);
     Assert.IsTrue(queue.Name.Equals(_localTestContext.Properties["QueueName"].ToString(), StringComparison.OrdinalIgnoreCase));
     Assert.IsTrue(!string.IsNullOrWhiteSpace(queue.Url));
     Assert.IsTrue(sqs.QueueExists(queue));
     Assert.IsTrue(!sqs.ErrorExists, sqs.ErrorMessage);
     Console.Out.WriteLine("Queue: {0}, {1}", queue.Name, queue.Url);
     _localTestContext.Properties.Add("Queue", queue);
 }
コード例 #3
0
        public void CreateQueue()
        {
            var sqs   = new NAV.AWS.SQS.Service(AWS.Credentials);
            var queue = sqs.CreateQueue(_localTestContext.Properties["QueueName"].ToString());

            Assert.IsTrue(!sqs.ErrorExists, sqs.ErrorMessage);
            Assert.IsTrue(queue.Name.Equals(_localTestContext.Properties["QueueName"].ToString(), StringComparison.OrdinalIgnoreCase));
            Assert.IsTrue(!string.IsNullOrWhiteSpace(queue.Url));
            Assert.IsTrue(sqs.QueueExists(queue));
            Assert.IsTrue(!sqs.ErrorExists, sqs.ErrorMessage);
            Console.Out.WriteLine("Queue: {0}, {1}", queue.Name, queue.Url);
            _localTestContext.Properties.Add("Queue", queue);
        }
コード例 #4
0
        public void SendMessage()
        {
            var sqs   = new NAV.AWS.SQS.Service(AWS.Credentials);
            var queue = _localTestContext.Properties["Queue"] as NAV.AWS.SQS.Queue;

            Assert.IsNotNull(queue);
            var message = new Message(queue)
            {
                Body = "Test Message", DelaySeconds = 0
            };

            sqs.SendMessage(message);
            Assert.IsTrue(!string.IsNullOrWhiteSpace(message.AwsAssignedId));
            Console.Out.WriteLine("Message: {0}", message.AwsAssignedId);
        }