Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Performing actions before and after tests

Perform pre-test setup and post-test cleanup to ensure your tests run in the right conditions.
Read time 1 minuteLast updated 17 days ago

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 testsUse Unity Test Framework APIs for test setup and tear down.
Performing actions before setup or after tear downUse the IOuterUnityTestAction API to do work outside the test before setup and after tear down.
Setting up and cleaning up at build timeMake changes to Unity or the file system before building tests and then clean up these changes after the test run.
Execution order of test actionsUnderstand the order in which test actions run relative to one another.

Additional resources