Skip to content

twodog.Testing.HeadlessFixture

Starts a Godot test fixture with --headless.

csharp
public class HeadlessFixture : FixtureBase

Package: 2dog.engine
Namespace: twodog.Testing

This is the usual fixture for game-logic, scene, resource, and CI tests. Use Fixture when a test needs rendering or a window.

Inherited Properties

PropertyTypeDescription
Enginetwodog.EngineEngine owned by the fixture
GodotInstanceGodot.GodotInstanceRunning native instance
TreeGodot.SceneTreeActive scene tree

xUnit Collection

HeadlessCollection supplies this fixture to a non-parallel xUnit collection.

csharp
using twodog.Testing;
using twodog.Testing.Xunit;
using Xunit;

[Collection<HeadlessCollection>]
public class SceneTests(HeadlessFixture godot)
{
    [Fact]
    public void SceneTree_IsRunning() => Assert.NotNull(godot.Tree.Root);
}