}
catch (NotEmptyException)
{
- throw new TrueException(PrintProcesses(), false);
+ throw new TrueException(PrintProcesses(currentProcess), false);
}
Assert.All(processes, process => Assert.Equal(".", process.MachineName));
return;
// Outputs a list of active processes in case of failure: https://github.com/dotnet/corefx/issues/35783
- string PrintProcesses()
+ string PrintProcesses(Process currentProcess)
{
StringBuilder builder = new StringBuilder();
foreach (Process process in Process.GetProcesses())
builder.AppendLine();
}
- builder.AppendFormat("Current process id: {0}", Process.GetCurrentProcess().Id);
+ builder.AppendFormat("Current process id: {0} Process name: '{1}'", currentProcess.Id, currentProcess.ProcessName);
return builder.ToString();
}
}