You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
usingSystem.Collections.Generic;
usingCake.Core.IO;
namespaceCake.Testing
{
/// <summary>
/// Implementation of a fake process.
/// </summary>
publicsealedclassFakeProcess:IProcess
{
privateint_exitCode;
privateIEnumerable<string>_standardError;
privateIEnumerable<string>_standardOutput;
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
publicvoidDispose()
{
}
/// <summary>
/// Waits for the process to exit
/// </summary>
publicvoidWaitForExit()
{
}
/// <summary>
/// Waits for the process to exit with possible timeout for command.
/// </summary>
/// <param name="milliseconds">The amount of time, in milliseconds, to wait for the associated process to exit. The maximum is the largest possible value of a 32-bit integer, which represents infinity to the operating system.</param>
/// <returns>true if the associated process has exited; otherwise, false.</returns>
publicboolWaitForExit(intmilliseconds)
{
returntrue;
}
/// <summary>
/// Gets the exit code.
/// </summary>
/// <returns>The process exit code.</returns>
publicintGetExitCode()
{
return_exitCode;
}
/// <summary>
/// Get the standard error of process
/// </summary>
/// <returns>Returns process error output <see cref="ProcessSettings.RedirectStandardError">RedirectStandardError</see> is true</returns>
publicIEnumerable<string>GetStandardError()
{
return_standardError;
}
/// <summary>
/// Get the standard output of process
/// </summary>
/// <returns>Returns process output <see cref="ProcessSettings.RedirectStandardOutput">RedirectStandardOutput</see> is true</returns>
publicIEnumerable<string>GetStandardOutput()
{
return_standardOutput;
}
/// <summary>
/// Immediately stops the associated process.
/// </summary>
publicvoidKill()
{
}
/// <summary>
/// Sets the exit code.
/// </summary>
/// <param name="exitCode">The exit code.</param>
publicvoidSetExitCode(intexitCode)
{
_exitCode=exitCode;
}
/// <summary>
/// Sets the standard error.
/// </summary>
/// <param name="standardError">The standard error.</param>