Table of Contents

Class HostResult

Namespace
Valheim.Testing.GameSessions
Assembly
Valheim.Testing.GameSessions.dll

One host script run. Output has carriage returns removed; ExitCode is set only when Outcome is Exited.

public sealed record HostResult
Inheritance
object
HostResult

Constructors

HostResult(HostOutcome, int?, string, string, TimeSpan, bool)

One host script run. Output has carriage returns removed; ExitCode is set only when Outcome is Exited.

public HostResult(HostOutcome Outcome, int? ExitCode, string Stdout, string Stderr, TimeSpan Elapsed, bool TimedOut)

Parameters

Outcome HostOutcome
ExitCode int?
Stdout string
Stderr string
Elapsed TimeSpan
TimedOut bool

Properties

Elapsed

public TimeSpan Elapsed { get; init; }

Property Value

TimeSpan

ExitCode

public int? ExitCode { get; init; }

Property Value

int?

Failed

The script ran and exited non-zero. A transport failure or an unknown outcome is not a failure of the script.

public bool Failed { get; }

Property Value

bool

Outcome

public HostOutcome Outcome { get; init; }

Property Value

HostOutcome

Stderr

public string Stderr { get; init; }

Property Value

string

Stdout

public string Stdout { get; init; }

Property Value

string

Succeeded

The script exited 0.

public bool Succeeded { get; }

Property Value

bool

TimedOut

public bool TimedOut { get; init; }

Property Value

bool

Methods

Describe()

public string Describe()

Returns

string

EnsureSuccess(string)

Returns this result if the script exited 0; otherwise throws HostOperationException describing what.

public HostResult EnsureSuccess(string what)

Parameters

what string

Returns

HostResult