Hello
I wonder how to seperate methods which return IEnumerator with yield.
For example I have the following nearly identical tests (it doens’t matter if the tests make sense):
[UnityTest]
public IEnumerator WaitFor1Second()
{
float startTime = Time.time;
yield return new WaitForSeconds(1f);
Assert.AreEqual(1f, Time.time - startTime, 0.1f);
}
[UnityTest]
public IEnumerator WaitFor2Seconds()
{
float startTime = Time.time;
yield return new WaitForSeconds(2f);
Assert.AreEqual(2f, Time.time - startTime, 0.1f);
}
How can I split those tests up? At the end it should look like this:
[UnityTest]
public IEnumerator WaitFor1Second()
{
yield return WaitSecondsTest(1f);
}
[UnityTest]
public IEnumerator WaitFor2Seconds()
{
yield return WaitSecondsTest(2f);
}
Thanks and have a great day!