WotR.Testing.Offline
0.1.0-preview.1
See the version list below for details.
dotnet add package WotR.Testing.Offline --version 0.1.0-preview.1
NuGet\Install-Package WotR.Testing.Offline -Version 0.1.0-preview.1
<PackageReference Include="WotR.Testing.Offline" Version="0.1.0-preview.1" />
<PackageVersion Include="WotR.Testing.Offline" Version="0.1.0-preview.1" />
<PackageReference Include="WotR.Testing.Offline" />
paket add WotR.Testing.Offline --version 0.1.0-preview.1
#r "nuget: WotR.Testing.Offline, 0.1.0-preview.1"
#:package WotR.Testing.Offline@0.1.0-preview.1
#addin nuget:?package=WotR.Testing.Offline&version=0.1.0-preview.1&prerelease
#tool nuget:?package=WotR.Testing.Offline&version=0.1.0-preview.1&prerelease
WotR.Testing.Offline
Runs a Pathfinder: Wrath of the Righteous mod against the real game assemblies,
vanilla blueprint pack and settings on the game's own Unity Mono runtime (or .NET
Framework), without starting Wrath.exe or the Unity player. The mod is loaded through the entry method
in its Info.json, and its blueprints are created by its own patches on the
game's BlueprintsCache.Init.
Status: preview; the API may change. Verified with WotR 2.7.0, AttributeFeats (BlueprintCore) and TabletopTweaks-Base with TabletopTweaks-Core as a dependency mod. See docs/offline.md for how it works, every environment adaptation and the known limits.
The library and its NuGet package contain no game files. Game assemblies are referenced at compile time from your own installation and copied and rewritten on the test machine. License: AGPL-3.0 with an additional permission for use together with the game and Unity assemblies.
Use it in a mod's test project
Requirements: Windows, the .NET SDK, PowerShell 7, a UnityModManager mod with
Info.json in its build output, and the game installed (or a snapshot from
New-WotrSnapshot.ps1).
From NuGet
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<WotrModAssembly>../MyMod/bin/Debug/MyMod.dll</WotrModAssembly>
<WrathInstallDir>C:/Games/Pathfinder Second Adventure</WrathInstallDir>
</PropertyGroup>
<ItemGroup>
<WotrDependencyMod Include="../deps/TabletopTweaks-Core/TabletopTweaks-Core.dll" />
<PackageReference Include="WotR.Testing" Version="0.1.0-preview.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
</Project>
WotR.Testing is the meta-package for all WotR.Testing components; referencing
WotR.Testing.Offline directly works the same. The build targets are imported
automatically. Its runner and snapshot
scripts are in the package's tools/ folder, which the project reports as
WotrToolsDirectory:
$tools = dotnet msbuild tests/MyMod.Tests/MyMod.Tests.csproj -getProperty:WotrToolsDirectory
pwsh -NoProfile -File "$($tools.Trim())Invoke-WotrOfflineTests.ps1" -Project tests/MyMod.Tests/MyMod.Tests.csproj
From a Git submodule
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<WotrModAssembly>../MyMod/bin/Debug/MyMod.dll</WotrModAssembly>
<WrathInstallDir>C:/Games/Pathfinder Second Adventure</WrathInstallDir>
</PropertyGroup>
<Import Project="../../external/wotr-testing/src/WotR.Testing.Offline/build/WotR.Testing.Offline.targets" />
<ItemGroup>
<WotrDependencyMod Include="../deps/TabletopTweaks-Core/TabletopTweaks-Core.dll" />
<ProjectReference Include="../../external/wotr-testing/src/WotR.Testing.Offline/WotR.Testing.Offline.csproj" AdditionalProperties="WotrInputRoot=$(WotrInputRoot)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
</Project>
The default -Runtime mono of Invoke-WotrOfflineTests.ps1 runs xUnit v2 test
projects on the game's own Mono runtime; other test frameworks can use
-Runtime netfx. Add xunit.runner.json with "appDomain": "denied" and "shadowCopy": false,
copied to the output. Build the mod without deploying it to the game.
public sealed class MyModGame : WotrGameFixture
{
// Optional: fail initialization unless the mod reports success.
protected override void VerifyModInitialized(GameSession session) { }
}
[CollectionDefinition("game")]
public sealed class GameCollection : ICollectionFixture<MyModGame> { }
[Collection("game")]
public sealed class MyFeatTests
{
private readonly MyModGame game;
public MyFeatTests(MyModGame game) => this.game = game;
[Fact]
public void FeatAddsBonus()
{
game.RequireGame();
var unit = OfflineGame.CreateUnit("<vanilla unit blueprint guid>");
var before = OfflineGame.StatSnapshot(unit);
unit.Progression.Features.AddFeature(OfflineGame.Blueprint<BlueprintFeature>("<feat guid>"));
// assert on unit.Stats, then remove the fact and compare with before
}
}
Game types can be used anywhere in test classes. The targets generate a module
initializer into the test assembly that installs the game assembly resolver; the
first request for a game assembly, even while the test framework discovers tests,
prepares the runtime folder. If your project already defines
System.Runtime.CompilerServices.ModuleInitializerAttribute, set
WotrGenerateModuleInitializer=false and call OfflineRuntime.InstallResolver()
from your own module initializer.
Catch UnityNative.IsUnavailable(error) and skip with UnityNative.SkipReason(...)
when a path reaches Unity engine code; such results are reported as
unity-runtime-required, never as passed.
Build properties and variables
| Name | Purpose |
|---|---|
WotrModAssembly |
Built mod DLL (required). Info.json and private DLLs such as BlueprintCore.dll are read from its directory |
WotrDependencyMod (items) |
Other built mods loaded with it, ordered by Requirements/LoadAfter |
WotrXunitConsoleVersion |
xUnit v2 console runner for -Runtime mono (default 2.9.2), downloaded with PackageDownload |
WotrInputRoot / WOTR_INPUT_ROOT |
Game root; otherwise WotrSnapshotDirectory (with manifest.json), then WrathInstallDir/WrathPath/WRATH_PATH |
WotrWorkDirectory |
Rewritten runtime cache and per-run state (default obj/wotr/) |
WotrReportDirectory / WOTR_OFFLINE_REPORT_DIR |
Where environment.json is written |
WOTR_ALLOW_UNVERIFIED_VERSION=1 |
Run on a game version not yet verified (reported as unverified) |
WotrDlc / WOTR_DLC |
Available DLCs: all (default), none, local (installed in the Steam library) or names such as Dlc4,Dlc6 |
WOTR_NO_UPDATE_CHECK=1 |
Skip the BlueprintCore release check (also -NoUpdateCheck on the runner) |
WotrHarmony / WOTR_HARMONY |
The 0Harmony.dll the run loads: umm (default, UnityModManager's copy), game (Wrath_Data/Managed) or a path; the runner's -Harmony also takes a Lib.Harmony version such as 2.2.2 |
WotrHarmonyReference (items) / WOTR_HARMONY_REFERENCES |
Harmony copies the mods are compared with (default game); members they lack are warned. The runner's -HarmonyReference also takes versions |
API
| Type | Use |
|---|---|
WotrGameFixture |
Boots the session once; RequireGame(), Observations, Session; writes environment.json on dispose |
GameSession |
Startup stages, loaded Mods in load order, mod under test's log, entry path and assembly |
OfflineGame |
Blueprint<T>(guid), CreateUnit(guid), StatSnapshot(unit) |
UnityNative |
Recognize and report paths that need the Unity engine |
IlComparison |
Prove that rewritten game and mod copies keep every method body |
OfflineRuntime |
IsUnityMono/RuntimeKind, runtime folder, inputs and rewrite counts |
Boundaries |
Registry of environment adaptations and their hit counts |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- AssetsTools.NET (>= 3.0.5)
- Mono.Cecil (>= 0.11.6)
- System.Text.Json (>= 8.0.5)
- xunit.runner.console (>= 2.9.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on WotR.Testing.Offline:
| Package | Downloads |
|---|---|
|
WotR.Testing
Test tooling for Pathfinder: Wrath of the Righteous mods. Offline tests run against the real game assemblies on Unity Mono without starting the game. Interface fuzzing automatically generates method calls and arguments, shrinks failures and replays saved cases. Game files come from your own installation and are never part of the packages. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.3 | 65 | 10/18/2026 |
| 0.1.0-preview.2 | 82 | 10/18/2026 |
| 0.1.0-preview.1 | 71 | 10/16/2026 |