Class FakeDataRoot
For no-game tests only: within this scope (the current async flow), ValheimTesting's own folder on this machine is
Directory instead of %LOCALAPPDATA%\ValheimTesting (macOS ~/Library/Application Support/ValheimTesting,
Linux $XDG_DATA_HOME/ValheimTesting). The run journal that records every copy this process makes
(Copy(string, string, IReadOnlyDictionary<string, string>), a run's runtime copies), the default host lock, leases and runs, and
DataRoot all move with it, so a test that copies a fixture never adds a run to the machine's
valheim-test env status, and a test killed mid-run never leaves one that makes env preflight refuse real runs.
A copy keeps journalling where it was made, whichever flow retires it. Never use this scope in a run with a game: the
machine's tools would not see that run. This scope is the only way to change the folder: there is no environment variable,
setter or plan field. Scopes nest: disposing one restores the one it was opened in. Dispose the innermost first; disposing
an outer scope while an inner one is open throws and changes nothing.
public sealed class FakeDataRoot
- Inheritance
-
objectFakeDataRoot
Constructors
FakeDataRoot(string)
public FakeDataRoot(string directory)
Parameters
directorystring
Properties
Directory
The folder standing in for ValheimTesting's own; the run journal is its journal folder.
public string Directory { get; }
Property Value
- string
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()