public void CreateQueueTwice_Should_Succeed()
        {
            // Setup
            // TODO: Replace this with a mocked factory.
            IAwsClientFactory awsClientFactory = new AwsClientFactory();
            ITaskLogger       logger           = new NullLogger();

            var task = new CreateSQSQueueTask(awsClientFactory, logger)
            {
                EncryptionContainerName = TestHelper.EncryptionContainerName,
                QueueName = "TestQ"
            };

            var task2 = new CreateSQSQueueTask(awsClientFactory, logger)
            {
                EncryptionContainerName = TestHelper.EncryptionContainerName,
                QueueName = "TestQ"
            };

            // Execute
            bool suceeded  = task.Execute();
            bool suceeded2 = task2.Execute();

            // Test
            Assert.IsTrue(suceeded, "Did not suceed");
            Assert.IsTrue(suceeded2, "Task 2 did not suceed");

            Assert.IsNotNullOrEmpty(task.QueueUrl, "QueueUrl");
            Assert.AreEqual(task.QueueUrl, task2.QueueUrl, "Second queue url did not match first");
        }
Example #2
0
        /// <summary>
        /// Create a queue on AWS to use for testing.
        /// </summary>
        /// <param name="queueName"></param>
        /// <param name="encryptionContainerName"></param>
        /// <returns></returns>
        public static string CreateQueue(string queueName, string encryptionContainerName)
        {
            var createSqsQueueTask = new CreateSQSQueueTask(new AwsClientFactory(), new NullLogger())
            {
                QueueName = queueName,
                EncryptionContainerName = encryptionContainerName
            };

            createSqsQueueTask.Execute();

            Debug.WriteLine("TestHelper created SQS Queue: " + createSqsQueueTask.QueueUrl);

            return(createSqsQueueTask.QueueUrl);
        }
        public void CreateQueue_Should_CreateQueue()
        {
            // Setup
            // TODO: Replace this with a mocked factory.
            IAwsClientFactory awsClientFactory = new AwsClientFactory();
            ITaskLogger       logger           = new NullLogger();

            var task = new CreateSQSQueueTask(awsClientFactory, logger)
            {
                EncryptionContainerName = TestHelper.EncryptionContainerName,
                QueueName = "TestQ"
            };

            // Execute
            bool suceeded = task.Execute();

            // Test
            Assert.IsTrue(suceeded, "Did not suceed");
            Assert.IsNotNullOrEmpty(task.QueueUrl, "QueueUrl");
        }