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(); }
public override void Initialize() { base.Initialize(); _osProcesses = Substitute.For <IOsProcesses>(); var commandLineProcess = Substitute.For <IOsProcess>(); commandLineProcess.StandardOutput.Returns(StreamReader.Null); _osProcesses.CommandLineProcess().ReturnsForAnyArgs(commandLineProcess); }