Beispiel #1
0
        public void Execute_Hibernation_WillHibernate()
        {
            CmdLinePowerControllerMock powerController = new CmdLinePowerControllerMock(
                Substitute.For <ILogger <CmdLinePowerControllerMock> >());
            ICommand cmd = new HibernateCommand(powerController);

            cmd.Execute();

            Assert.Equal(1, powerController.NumOfHibernations);
        }
Beispiel #2
0
        public NightlyShutdownSchedulerTest()
        {
            var locations = new Locations(".", "shutdown history.txt", "shutdownHistory.json");

            File.Delete(locations.ShutdownHistoryFilePath);
            powerController        = new CmdLinePowerControllerMock(Substitute.For <ILogger <CmdLinePowerControllerMock> >());
            shutdownHistoryStorage = new ShutdownHistoryStorage(locations);
            shutdownCalculator     = new NightlyShutdownCalculator();
            shutdownCommandFactory = new ParameterizedShutdownCommandFactory(
                powerController);
            nightlyShutdownScheduler = new NightlyShutdownScheduler(
                shutdownHistoryStorage,
                shutdownCalculator,
                shutdownCommandFactory,
                Substitute.For <ILogger <NightlyShutdownScheduler> >());
        }