- Home /
Question by
mikeNspired · Apr 18, 2019 at 11:39 PM ·
testingtest
Playmode Testing writing clean duplicate code problem
I found someones tutorial showing that you can clean up duplicate code by running a coroutinelike this.
Ienumerator CheckThis(Gameobject x){
if(....)
yield break
else
Assert.Fail();
}
Now I can pass in objects to CheckThis to see if it passes with that object. To use that code I run a Test like this.
[UnityTest]
Ienumerator Check_Player(){
yield return CheckThis(Player);
}
My problem is when CheckThis fails because of Assert.Fail(). All I get is an error in the console showing that it failed. The test just keeps going till the timeout happens.
Comment