Ejemplo n.º 1
0
        public void TestPanicNotInitiatedUnderFifteenMinutes()
        {
            var paniced = false;
            var observer = new ServiceObserver() {
                Panic = () => { paniced = true; }
            };

            // We've only been down for less than a second so it shouldn't fire.
            observer.PanicTask_Tick(null);

            Assert.IsFalse(paniced);
        }
Ejemplo n.º 2
0
        public void TestPanicDowntimeOverFifteenMinutes()
        {
            var paniced = false;
            var observer = new ServiceObserver() {
                Panic = () => { paniced = true; },
                StopTime = DateTime.Now.AddMinutes(-16)
            };

            // We've only been down for less than a second so it shouldn't fire.
            observer.PanicTask_Tick(null);

            Assert.IsTrue(paniced);
        }