Version: Unity 6.2 (6000.2)
Language : English
Writing tests
Setting up and tearing down tests

Performing actions before and after tests

Write reliable tests by performing the appropriate pre-test setup and post-test cleanup work to ensure your tests run in the right state. Unity Test Framework has a range of APIs that allow you to perform work at defined stages before and after a test run.

Topic Description
Setting up and tearing down tests Use Unity Test Framework APIs for test setup and tear down.
Performing actions before setup or after tear down Use the IOuterUnityTestAction API to do work outside the test before setup and after tear down.
Setting up and cleaning up at build time Make changes to Unity or the file system before building tests and then clean up these changes after the test run.
Execution order of test actions Understand the order in which test actions run relative to one another.

Additional resources

Writing tests
Setting up and tearing down tests
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961