docs.unity.cn
    Show / Hide Table of Contents

    Custom attributes

    As a part of Unity Test Framework's public API we provide the following attributes:

    Attributes

    Attribute Description
    ParameterizedIgnore A custom alternative to NUnit Ignore that allows ignoring tests based on parameters passed to the test method. See ParameterizedIgnoreAttribute.
    PostBuildCleanup Make changes to Unity or the file system after building. See Setup and cleanup at build time.
    PrebuildSetup Make changes to Unity or the file system before building. See Setup and cleanup at build time.
    PreservedValues Like NUnit Values this is used to provide literal arguments for an individual test parameter. See PreservedValuesAttribute.
    RequirePlatformSupport Require Player build support for the specified platforms in order to run tests. See RequirePlayformSupportAttribute.
    RequiresPlayMode Can be applied to an assembly, fixture, or individual test to indicate that tests under its scope should (or should not) run in the Editor's Play Mode. See RequiresPlayMode.
    TestMustExpectAllLogs Enforces that every log entry must be expected for a test to pass. See TestMustExpectAllLogsAttribute.
    TestPlayerBuildModifier Modify Player build options or split build and run. See TestPlayerBuildModifierAttribute.
    TestRunCallback Assembly level attribute used to subscribe a given type to updates on the test progress. See TestRunCallbackAttribute.
    UnityPlatform Define which platforms tests should run on. See UnityPlatformAttribute.
    UnitySetUp Unity extension of NUnit SetUp to allow Unity yield instructions. See Actions outside tests.
    UnityTearDown Unity extension of NUnit TearDown to allow Unity yield instructions. Actions outside tests.
    UnityTest Unity extension of NUnit Test to allow skipping frames and Unity yield instructions. See UnityTestAttribute.
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Monday, November 14, 2022
    Terms of use