Пример #1
0
        private void RebootAction()
        {
            var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\RunOnce", true);

            key?.SetValue("", _updateState.FilePath);

            _osProcesses.CommandLineProcess("/C shutdown -f -r -t 0").Start();
        }
Пример #2
0
        public override void Initialize()
        {
            base.Initialize();

            _osProcesses = Substitute.For <IOsProcesses>();

            var commandLineProcess = Substitute.For <IOsProcess>();

            commandLineProcess.StandardOutput.Returns(StreamReader.Null);

            _osProcesses.CommandLineProcess().ReturnsForAnyArgs(commandLineProcess);
        }