GDUnit4 的官方 C# 实现 - 这是一个面向 Godot 4 的全面性单元测试框架。特点包括 VS/Rider 测试适配器集成、参数化测试、场景测试等。
GDUnit4 的官方 C# 实现 - 这是一个面向 Godot 4 的全面性单元测试框架。特点包括 VS/Rider 测试适配器集成、参数化测试、场景测试等。
The Unit Testing Framework in C# for Godot
This version of GdUnit4.api is based on Godot v4.4.stable.mono.official [4c311cbee] (master branch)
Supported Godot Versions
Supported .NET Versions
GdUnit4Net is a feature-complete unit testing framework for Godot C# projects that is fully compatible with the VSTest standard. It provides an API and VS test adapter to run your Godot C# tests seamlessly in Visual Studio (Code), JetBrains Rider, and any VSTest-compatible environment.
High Performance: Up to 10x faster test execution for logic-only tests
VSTest Compatible: Full integration with Visual Studio Test Platform
⚡ Smart Runtime: Tests run without Godot runtime by default, with opt-in Godot features
Feature Complete: All standard testing features you expect from modern frameworks
[RequireGodotRuntime] for Godot-specific featuresGdUnit4Net v5.0 introduces a major architecture overhaul that revolutionizes test performance and compatibility:
[RequireGodotRuntime] attribute only for tests that actually need Godot features⚠️ Please read the release notes about breaking changes. ⚠️
There are three packages available in this project:
Checkout the gdUnit4.api README to install and use the core testing framework.
Checkout the gdUnit4.test.adapter README to install and use the test adapter. This adapter now supports powerful test filtering capabilities for selectively running tests based on specific criteria.
For compile-time validation of your test code, check out the gdUnit4.analyzers README.
The gdUnit4NetExamples repository provides comprehensive example projects demonstrating both basic and advanced GdUnit4Net usage patterns. It includes foundational examples for newcomers learning unit testing fundamentals, as well as sophisticated examples covering professional configurations, complex testing scenarios, input simulation, signal testing, and exception handling. These working examples showcase GdUnit4Net v5.0 features including selective Godot runtime usage, advanced scene testing, and production-ready test setups.
…Run tests with advanced filtering using VSTest standard syntax:
# Run only fast tests
dotnet test --filter "Trait=Speed:Fast"
# Run integration tests
dotnet test --filter "Category=Integration"
# Run tests by name pattern
dotnet test --filter "FullyQualifiedName~Calculator"
# Combine multiple filters
dotnet test --filter "(Category=Integration)|(Trait=Speed:Fast)"The test run looks like this:
[RequireGodotRuntime] when you actually need Godot featuresHow to setup GdUnit4 for C#
Supported IDE's
Test Filtering Guide
Important: v5.0 includes breaking changes that require minimal code updates: ⚠️ Please read the release notes about breaking changes. ⚠️
[RequireGodotRuntime] to tests that use Godot features (Nodes, Scenes, Resources)Thank you for your interest in contributing to GdUnit4!
To ensure a smooth and collaborative contribution process, please review our contribution guidelines before getting started. These guidelines outline the standards and expectations we uphold in this project.
Code of Conduct: We strictly adhere to the Godot code of conduct in this project. As a contributor, it is important to respect and follow this code to maintain a positive and inclusive community.
Using GitHub Issues: We utilize GitHub issues for tracking feature requests and bug reports. If you have a general question or wish to engage in discussions, we recommend joining the GdUnit Discord Server for specific inquiries.
We value your input and appreciate your contributions to make GdUnit4 even better!
This project is licensed under the MIT License - see the LICENSE file for details.
暂无开放 Issues,或尚未同步最近议题。