Table of Contents

Class FakeExecScript

Namespace
OpenShell.Testing
Assembly
OpenShell.Sdk.Testing.dll

The scripted outcome of a command.

public sealed record FakeExecScript : IEquatable<FakeExecScript>
Inheritance
FakeExecScript
Implements
Inherited Members

Constructors

FakeExecScript(int, ReadOnlyMemory<byte>, ReadOnlyMemory<byte>)

The scripted outcome of a command.

public FakeExecScript(int ExitCode, ReadOnlyMemory<byte> Stdout = default, ReadOnlyMemory<byte> Stderr = default)

Parameters

ExitCode int

The exit code.

Stdout ReadOnlyMemory<byte>

Standard output bytes.

Stderr ReadOnlyMemory<byte>

Standard error bytes.

Properties

ExitCode

The exit code.

public int ExitCode { get; init; }

Property Value

int

Stderr

Standard error bytes.

public ReadOnlyMemory<byte> Stderr { get; init; }

Property Value

ReadOnlyMemory<byte>

Stdout

Standard output bytes.

public ReadOnlyMemory<byte> Stdout { get; init; }

Property Value

ReadOnlyMemory<byte>

Methods

Failure(int, string)

A failing exit code with the given standard error.

public static FakeExecScript Failure(int exitCode, string stderr = "")

Parameters

exitCode int
stderr string

Returns

FakeExecScript

Success(string)

A zero exit code with the given standard output.

public static FakeExecScript Success(string stdout = "")

Parameters

stdout string

Returns

FakeExecScript