Beispiel #1
0
        public void RebootOnSchedule()
        {
            string[] oArgsStrings = new[] { "-ip", "192.168.0.1", "-reboot", "06:30" };
            SetTestTime(6, 32);
            oNBNRebooter.Run(oArgsStrings);
            UnitTestModem oTestModem = (UnitTestModem)oNBNRebooter.RebooterProperties.CurrentModem;

            Assert.AreEqual(1, oTestModem.PeformRebootCallCount, "Check reboot command was sent");
        }
Beispiel #2
0
        public void RebootOnStart()
        {
            string[] oArgsStrings = new[] { "-ip", "192.168.0.1", "-rebootnow", "-reboot", "06:30" };
            SetTestTime(7, 35);
            oNBNRebooter.Run(oArgsStrings);
            UnitTestModem oTestModem = (UnitTestModem)oNBNRebooter.RebooterProperties.CurrentModem;

            Assert.IsFalse(oConsoleOutput.ToString().Contains("No modem IP provide, please see the help for parameter usage."), "Check IP was found");
            Assert.IsTrue(oConsoleOutput.ToString().Contains("Reboot will occur immediately..."), "Check reboot command was found");
            Assert.AreEqual(1, oTestModem.PeformRebootCallCount, "Check start up reboot command was sent");

            // Simulate that last reboot was 30 minutes ago.
            oNBNRebooter.OverrideMinutesSinceReboot = true;
            SetTestTime(6, 31);
            oNBNRebooter.DoTimedEvents(oNBNRebooter.RebooterProperties);
            Assert.AreEqual(2, oTestModem.PeformRebootCallCount, "Check scheduled reboot command was sent");
        }