public void Launch_ShouldStart_ElevatedProcess() { var launchable = new LaunchableFile(_processes); launchable.Launch("", ""); _processes.ElevatedProcess("", "").Received(1).Start(); }
public void Valid_ShouldPassException_WhenElevatedProcess_Start_Throws() { _processes.ElevatedProcess("", "").WhenForAnyArgs(x => x.Start()).Throws <Exception>(); var launchable = new LaunchableFile(_processes); Action action = () => launchable.Launch("", ""); action.Should().Throw <Exception>(); }
public void Launch_ShouldCreate_ElevatedProcess() { const string filename = "File to launch"; const string args = "Launch arguments"; var launchable = new LaunchableFile(_processes); launchable.Launch(filename, args); _processes.Received(1).ElevatedProcess(filename, args); }