- Home /
The question is answered, right answer was accepted
How to implement mandatory cleanup for the Unity PlayMode tests?
Hi everyone, Does anybody know how I can define a cleanup method as Mandatory after each test run (even if it fails) for PlayMode tests?
I tried to use nUnit TearDown (SetUp too) but received the following message:
"OneTimeSetUp: Invalid signature for SetUp or TearDown method: CleanUpMethodName".
Look like nUnit doesn't work for PlayMode tests. Do you have any other idea how it possible to do?
[SetUp] private void SetupEnvironmentAndInstantiateBulkConveyorWithLoadRotation() { isLoadEnd = true; EnvironmentSetup(); StraightConveyorInstantiationAndTransform(loadRotation); }
Answer by Tomek-Paszek · Apr 03, 2018 at 09:31 AM
It's an NUnit error. Try making the method public.
Thanks a lot. I have also used argument for SetUp. I have removed it and it works!
Follow this Question
Related Questions
Is there a limit to Test Runner play mode test duration? 2 Answers
How can I run Unity tests with some defined nUnit category 2 Answers
Unity Test Runner doesn't cleanup previous test results 1 Answer
TestRunner playmode IPrebuildSetup test doesn't run 1 Answer
How to import plugins inside tests in Unity Test Runner 1 Answer