Table of Contents

Class FixtureGate

Namespace
Valheim.Testing.Adapter
Assembly
Valheim.Testing.Adapter.CompileCheck.dll

The opt-in gate for commands that build fixtures in the world (spawn terrain, write saved objects): they run only in a process whose runner turned them on. A test adapter can be installed in a runtime that somebody else uses; its read-only observations are harmless there, but a fixture command must refuse unless the owned test session asked for it. Check at the start of the command:

if (FixtureGate.Refusal("MYMOD_TEST_FIXTURES", "MYMOD_TEST_SESSION_TOKEN") is string refused)
{ context.Fail("fixture_disabled", refused); yield break; }
public static class FixtureGate
Inheritance
object
FixtureGate

Methods

Refusal(string, string)

Null when the process was started with enableVariable set to exactly 1 and a nonempty session token in tokenVariable (the one TestExtension reports, which only an owned test session sets); otherwise why the fixture command must refuse.

public static string? Refusal(string enableVariable, string tokenVariable)

Parameters

enableVariable string
tokenVariable string

Returns

string