public void PublishesExitedEventOnError() { var arguments = new ProcessArguments("dotnet", "run --project Nopes"); var completionSource = new TaskCompletionSource <IProcessResult>(); arguments.Exited += (_, args) => completionSource.TrySetResult(args); arguments.Start(); var result = completionSource.Task.GetAwaiter().GetResult(); Assert.NotZero(result.ExitCode); }