2dog.nunit 4.7.2.134

dotnet add package 2dog.nunit --version 4.7.2.134
                    
NuGet\Install-Package 2dog.nunit -Version 4.7.2.134
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="2dog.nunit" Version="4.7.2.134" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="2dog.nunit" Version="4.7.2.134" />
                    
Directory.Packages.props
<PackageReference Include="2dog.nunit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add 2dog.nunit --version 4.7.2.134
                    
#r "nuget: 2dog.nunit, 4.7.2.134"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package 2dog.nunit@4.7.2.134
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=2dog.nunit&version=4.7.2.134
                    
Install as a Cake Addin
#tool nuget:?package=2dog.nunit&version=4.7.2.134
                    
Install as a Cake Tool

2dog.nunit

Reference 2dog.engine or 2dog.engine.double explicitly in the host project. This integration package works with either precision.

Run NUnit tests against a real Godot engine. Reference 2dog.nunit, NUnit and NUnit3TestAdapter 6.x, set OutputType to Exe and EnableNUnitRunner to true for Microsoft.Testing.Platform, or scaffold:

dnx 2dog add --nunit
dotnet test MyGame.nunit
using Godot;
using Timer = Godot.Timer;
using NUnit.Framework;
using twodog.Testing.NUnit;

public class MyTests : GodotTestFixture
{
    [Test]
    public async Task TimerEmitsTimeout()
    {
        var timer = new Timer { OneShot = true, WaitTime = 0.01 };
        try
        {
            EngineFixture.Tree.Root.AddChild(timer);
            using var signal = GodotAssert.ExpectSignal(timer, Timer.SignalName.Timeout);
            timer.Start();
            await signal.WaitAsync(EngineFixture);
            signal.AssertEmitted();
        }
        finally { timer.Free(); }
    }
}

GodotTestFixture shares an engine across the tests in each derived fixture. It starts without the configured main scene; load and instantiate scenes explicitly in tests. Project autoloads still initialize. Clean up scene instances and restore shared state, such as SceneTree.Paused, when a test changes it. NUnit's inherited SingleThreaded, NonParallelizable and FixtureLifeCycle(LifeCycle.SingleInstance) attributes keep setup, tests, async continuations and teardown on the engine's owner thread. Do not use ConfigureAwait(false) before accessing Godot, or thread-switching attributes such as Timeout or RequiresThread on these tests. The default fixture runs headless on Windows, Linux and macOS. Derive from GodotRenderingTestFixture for rendering on Windows/Linux with a display. It supplies Windows STA; the engine fixture activates common-controls v6 even inside NUnit's test process. Windowed macOS tests still need a runner that owns the process main thread; use xUnit's rendering collection there. Override CreateFixture() to supply a custom twodog.Testing.FixtureBase. Keep headless and rendering fixtures in separate test projects. Switching display modes in one process can crash native Godot; the fixtures reject it.

Use EngineFixture to access the running fixture. The older Godot property remains an alias for compatibility, but shadows the Godot namespace. Use unqualified type names or aliases such as using Timer = Godot.Timer;.

Godot errors and warnings fail tests, including startup, deferred work and engine shutdown. Consume expected reports with EngineFixture.Errors.Expect("message fragment"). Mark a test or class [AllowGodotErrors] to clear its reports after teardown. Override FailOnGodotErrors to disable checking for a fixture and preserve its error log.

The helpers in twodog.Testing.NUnit include:

  • GodotAssert.ExpectSignal(source, signal) subscribes immediately, counts emissions and checks an exact count with AssertEmitted(count = 1).
  • GodotAssert.ExpectSignal<T>(source, signal) also records one argument per emission in Values, in emission order.
  • await signal.WaitAsync(EngineFixture, count: 2) pumps until at least two emissions.
  • await EngineFixture.WaitUntilAsync(() => condition) advances frames until true.
  • await EngineFixture.AwaitAsync(task) pumps frames and propagates the result or failure.
  • await GodotAssert.FreedAsync(EngineFixture, node) waits for actual native deletion after QueueFree().

Waits default to five seconds, link NUnit's cancellation token, and permit one active pump per fixture. Timeouts are NUnit assertion failures. Signal waits disconnect on failure or cancellation; dispose expectations to disconnect after success. Disposal does not assert. A timed-out wait does not cancel its supplied task. Free native nodes in finally; disposing a C# wrapper does not free them.

The scaffold includes eight examples of async work, signals, typed arguments, timers, tree lifecycle and deferred deletion. Use dotnet test -c Editor for Editor APIs; the template adds the matching binding reference and EDITOR.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.7.2.134 0 10/22/2026
4.7.2.133 38 10/21/2026
4.7.2.132 36 10/21/2026
4.7.2.127 46 10/20/2026
4.7.2.126 59 10/20/2026
4.7.2.125 52 10/19/2026