public void CannotSendSignalIfAttachedToCurrentConsole()
{
var si = new ChildProcessStartInfo(TestUtil.TestChildNativePath, "ReportSignal")
{
StdInputRedirection = InputRedirection.InputPipe,
StdOutputRedirection = OutputRedirection.OutputPipe,
Flags = ChildProcessFlags.AttachToCurrentConsole,
};
using var sut = ChildProcess.Start(si);
Assert.False(sut.CanSignal);
Assert.Throws<InvalidOperationException>(() => sut.SignalInterrupt());
Assert.Throws<InvalidOperationException>(() => sut.SignalTermination());
Assert.Equal('R', sut.StandardOutput.ReadByte());
sut.Kill();
sut.WaitForExit();
Assert.NotEqual(0, sut.ExitCode);
}