public void ContinueIsWindowing()
 {
     StubSQSService service = new StubSQSService();
     service.Start();
     service.Pause();
     service.Continue();
     Assert.IsTrue(service.IsWindowing);
 }
 public void StopIsWindowing()
 {
     StubSQSService service = new StubSQSService();
     service.Start();
     service.Stop();
     Assert.IsFalse(service.IsWindowing);
 }
 public void StartIsWindowing()
 {
     StubSQSService service = new StubSQSService();
     service.Start();
     Assert.IsTrue(service.IsWindowing);
 }
        public void SQSWindowToSmall()
        {
            AddConfigValue("SQSWindow", "0.00:00:00.01");

            StubSQSService service = new StubSQSService();
            Assert.AreEqual(new TimeSpan(0, 0, 1), service.SQSWindow);

            RemoveConfigValue("SQSWindow");
        }
        public void SQSWindowToLarge()
        {
            AddConfigValue("SQSWindow", "2.00:00:00");

            StubSQSService service = new StubSQSService();
            Assert.AreEqual(new TimeSpan(1, 0, 0, 0), service.SQSWindow);

            RemoveConfigValue("SQSWindow");
        }
        public void SQSWindowInvalid()
        {
            AddConfigValue("SQSWindow", "abc");

            StubSQSService service = new StubSQSService();
            Assert.AreEqual(new TimeSpan(0, 1, 0), service.SQSWindow);

            RemoveConfigValue("SQSWindow");
        }
 public void SQSWindowDefault()
 {
     StubSQSService service = new StubSQSService();
     Assert.AreEqual(new TimeSpan(0, 1, 0), service.SQSWindow);
 }
 public void PowerEventSuspendIsWindowing()
 {
     StubSQSService service = new StubSQSService();
     service.Start();
     service.PowerEvent(PowerBroadcastStatus.Suspend);
     Assert.IsFalse(service.IsWindowing);
 }
 public void PowerEventBatteryLowIsWindowing()
 {
     StubSQSService service = new StubSQSService();
     service.Start();
     service.PowerEvent(PowerBroadcastStatus.BatteryLow);
     Assert.IsFalse(service.IsWindowing);
 }
        public void NoQueueUrlConfiguredThrows()
        {
            String value = ConfigurationManager.AppSettings["QueueUrl"];
            RemoveConfigValue("QueueUrl");

            StubSQSService service = new StubSQSService();
            try
            {

                service.Start();
                Assert.Fail();
            }
            catch (ConfigurationErrorsException) { }

            AddConfigValue("QueueUrl", value);
        }
        public void NoAWSSecretAccessKeyThrows()
        {
            String value = ConfigurationManager.AppSettings["AWSSecretAccessKey"];
            RemoveConfigValue("AWSSecretAccessKey");

            StubSQSService service = new StubSQSService();
            try
            {
                service.Start();
                Assert.Fail();
            }
            catch (ConfigurationErrorsException) { }

            AddConfigValue("AWSSecretAccessKey", value);
        }