Use whenever C# code in a Unity game-engine project needs tests that use the Unity runtime or editor: Unity Test Framework EditMode vs PlayMode tests, [Test] and [UnityTest], assembly definitions, the Test Runner window, batch-mode command-line runs and CI. Not the ThrowTheSwitch C library.
83%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Attributes for unity-test-framework, per the v1.4 manual index and the NUnit 3.5 docs the framework wraps.
| Attribute | Purpose | Source |
|---|---|---|
[Test] | Plain NUnit test - synchronous | NUnit; recommended default per edit-mode-vs-play-mode docs |
[UnityTest] | Coroutine-style test that can yield frames / seconds in PlayMode or skip frames in EditMode | UTF-specific |
[SetUp] / [TearDown] | Per-test fixture setup / cleanup | NUnit |
[OneTimeSetUp] / [OneTimeTearDown] | Once-per-fixture setup / cleanup | NUnit |
[TestFixture] | Marks a class as containing tests (optional in NUnit 3) | NUnit |
[Category("Smoke")] | Tag a test for filtering | NUnit; selectable via CLI -testCategory |
[UnityPlatform(RuntimePlatform.WindowsPlayer)] | Restrict test to specific runtime platforms | UTF-specific |
[ValueSource(nameof(MyCases))] | Parameterised inputs | NUnit; ValueSource is supported per the v1.4 manual (other parameterised attributes have known limitations - see the skill's Limitations section) |