FakeProcess Class
Represents an in-memory process handle intended for tests.
public sealed class FakeProcess : IProcessHandle, IDisposable- Implements
Properties
Meziantou.Framework.IProcessHandle.ErrorStream
FakeProcess.csMeziantou.Framework.IProcessHandle.ExitCode
FakeProcess.csMeziantou.Framework.IProcessHandle.HasExited
FakeProcess.csMeziantou.Framework.IProcessHandle.Id
FakeProcess.csMeziantou.Framework.IProcessHandle.InputStream
FakeProcess.csMeziantou.Framework.IProcessHandle.OutputStream
FakeProcess.csMeziantou.Framework.IProcessHandle.SafeProcessHandle
FakeProcess.csSafeProcessHandle? IProcessHandle.SafeProcessHandle { get; }Property value
No documentation is available.
Methods
| Name | Description |
|---|---|
| Complete(int?) | Completes the process execution and sets the process exit code. |
| Create(int) | Creates a fake process with empty standard output and standard error streams. |
| Create(int, Stream, Stream) | Creates a fake process with the specified standard output and standard error streams. |
| Create(int, string, string) | Creates a fake process with UTF-8 encoded text output. |
| CreatePending(int) | Creates a fake process that does not complete automatically when started. |
| CreatePending(int, Stream, Stream) | Creates a fake process with provided streams that does not complete automatically when started. |
| CreatePending(int, string, string) | Creates a fake process with text output that does not complete automatically when started. |
| Meziantou.Framework.IProcessHandle.Kill(bool) | |
| Meziantou.Framework.IProcessHandle.Start() | |
| Meziantou.Framework.IProcessHandle.WaitForExitAsync(CancellationToken) | |
| ReadInputAsText(Encoding?) | Reads the captured standard input text as UTF-8 by default. |
| System.IDisposable.Dispose() |
Complete(int?)
FakeProcess.csCreate overloads
Create(int)
FakeProcess.csCreates a fake process with empty standard output and standard error streams.
public static FakeProcess Create(int exitCode)Create(int, Stream, Stream)
FakeProcess.csCreates a fake process with the specified standard output and standard error streams.
public static FakeProcess Create(int exitCode, Stream outputStream, Stream errorStream)Create(int, string, string)
FakeProcess.csCreatePending overloads
CreatePending(int)
FakeProcess.csCreates a fake process that does not complete automatically when started.
public static FakeProcess CreatePending(int exitCode)CreatePending(int, Stream, Stream)
FakeProcess.csCreates a fake process with provided streams that does not complete automatically when started.
public static FakeProcess CreatePending(int exitCode, Stream outputStream, Stream errorStream)CreatePending(int, string, string)
FakeProcess.csCreates a fake process with text output that does not complete automatically when started.
public static FakeProcess CreatePending(int exitCode, string outputText, string errorText)Meziantou.Framework.IProcessHandle.Kill(bool)
FakeProcess.csvoid IProcessHandle.Kill(bool entireProcessTree)Parameters
entireProcessTreebool
No documentation is available.
Meziantou.Framework.IProcessHandle.Start()
FakeProcess.csMeziantou.Framework.IProcessHandle.WaitForExitAsync(CancellationToken)
FakeProcess.csTask IProcessHandle.WaitForExitAsync(CancellationToken cancellationToken)No documentation is available.
ReadInputAsText(Encoding?)
FakeProcess.csSystem.IDisposable.Dispose()
FakeProcess.csvoid IDisposable.Dispose()No documentation is available.