Testing Duration With Unit Tests
Hi, I'm making a drop tile. When a player steps on it, the tile drops after 0.5 seconds.I did it using yield return new WaitForSeconds(0.5f);
. After that, I created a test script and I also used yield return new WaitForSeconds(0.5);
to check if the tile drops after 0.5 seconds later. However, the test returns false. When I replace yield return new WaitForSeconds(0.5f);
with yield return new WaitForSeconds(0.54f);
in the test script, the test returns true. What is going on here? Or do I really need to test this case?
Comment