2dog.xunit 4.7.1.59

dotnet add package 2dog.xunit --version 4.7.1.59
                    
NuGet\Install-Package 2dog.xunit -Version 4.7.1.59
                    
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.xunit" Version="4.7.1.59" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="2dog.xunit" Version="4.7.1.59" />
                    
Directory.Packages.props
<PackageReference Include="2dog.xunit" />
                    
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.xunit --version 4.7.1.59
                    
#r "nuget: 2dog.xunit, 4.7.1.59"
                    
#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.xunit@4.7.1.59
                    
#: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.xunit&version=4.7.1.59
                    
Install as a Cake Addin
#tool nuget:?package=2dog.xunit&version=4.7.1.59
                    
Install as a Cake Tool

2dog.xunit

xUnit collection definitions for testing Godot applications with 2dog.

The fixtures themselves (Fixture, HeadlessFixture, and FixtureBase) ship in the 2dog.engine package under twodog.Testing. This package adds the xUnit-specific glue.

What it provides

  • RenderingCollection - binds the rendering-enabled Fixture
  • HeadlessCollection - binds HeadlessFixture (use this for CI)

Both set DisableParallelization = true, which is required because Godot allows only one instance per process.

How it works

xUnit only discovers [CollectionDefinition] classes that live in the test assembly – a definition shipped in a referenced DLL is silently ignored (its DisableParallelization and ICollectionFixture<T> are not applied). To make the collections actually work, this package ships them as compile-in source: a build/2dog.xunit.targets file adds the collection definitions to your test project's compilation, so they end up in your test assembly where xUnit can find them.

You therefore do not write your own collection definition – just reference the package and use the collections directly.

Usage

using Godot;
using twodog.Testing;
using twodog.Testing.Xunit;
using Xunit;

[Collection<HeadlessCollection>]
public class MyTests(HeadlessFixture godot)
{
    [Fact]
    public void EngineStarts()
    {
        Assert.NotNull(godot.Tree);
    }
}

Custom fixtures

Need a different Godot configuration? Subclass FixtureBase and write a one-line collection for it in your own test project:

using twodog.Testing;
using Xunit;

public class OpenGl3Fixture() : FixtureBase("--rendering-driver", "opengl3");

[CollectionDefinition(nameof(OpenGl3Collection), DisableParallelization = true)]
public class OpenGl3Collection : ICollectionFixture<OpenGl3Fixture>;
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

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.1.59 0 7/28/2026
4.7.1.57 67 7/27/2026
Loading failed