Hello,
I’m currently attempting to make modular helper/auxillary methods for my PlayTests (to avoid duplicate code).
public IEnumerator navigateToGameScene()
{
gamepad1 = InputSystem.AddDevice<Gamepad>();
yield return new WaitForSeconds(0.3f);
Press(gamepad1.dpad.up);
Release(gamepad1.dpad.up);
yield return new WaitForSeconds(0.3f);
Press(gamepad1.dpad.up);
Release(gamepad1.dpad.up);
yield return new WaitForSeconds(0.3f);
Press(gamepad1.buttonSouth);
Release(gamepad1.buttonSouth);
}
However, some of these may require waiting for frames or some amount of seconds.
How do I call these helper/auxillary methods that aren’t tagged with [UnityTest]?
Using StartCoroutine(navigateToGameScene) doesn’t work.
Ideally this is what I’d want to do:
[UnityTest]
public IEnumerator somePlayTest()
{
//Do some test specific setup
//Call auxillary method e.g.
yield new StartCouroutine(navigateToGameScene);
//Some more code
//Assertion
}
Thanks in advance.