public void KillProcessAlreadyExited() { Process process = SpawnTestProcesses(1)[0]; ProcessKillerImpl.KillProcess(process); ProcessKillerImpl.KillProcess(process); }
public async void KillProcesses() { ICollection <Process> testProcesses = SpawnTestProcesses(2); testProcesses.Should().NotContain(process => process.HasExited, "haven't killed anything yet"); await processKiller.KillProcess("calc", cancellationTokenSource.Token); testProcesses.Should().OnlyContain(process => process.HasExited, "all processes should have been killed"); }
public void KillProcessNoPermissions() { Process systemIdleProcess = Process.GetProcessById(0); ProcessKillerImpl.KillProcess(systemIdleProcess); }