When writing tests, it is possible to avoid duplication of code by using the SetUp and TearDown methods built into NUnit. The Unity Test Framework has extended these methods with extra functionality, which can yield commands and skip frames, in the same way as UnityTest
.
The actions related to a test run in the following order:
[UnityOneTimeSetUp]
.[OneTimeSetup]
.BeforeTest
method of any attribute implementing IOuterUnityTestAction.[UnitySetUp]
.[SetUp]
.BeforeTest
method of Action attributes.AfterTest
method of Action attributes.[TearDown]
.[UnityTearDown]
.AfterTest
method of any attribute implementing IOuterUnityTestAction.[OneTimeTearDown]
.[UnityOneTimeTearDown]
.The list of actions is the same for both Test
and UnityTest
.