public IEnumerator BallBouncesFromBoardBounds() { _setup.DestroyAll(); GameObject ball = _setup.CreateBallForTest(); ball.GetComponent <Ball>().SetSpeed(0, 1); Camera cam = _setup.CreateCameraForTest(); float time = 0; while (time < 5) { ball.GetComponent <Ball>().Move(); time += Time.deltaTime; } yield return(new WaitForFixedUpdate()); Assert.Less(ball.transform.position.y, 5); }
public IEnumerator BallCanMoveIn2d() { _setup.DestroyAll(); GameObject ball = _setup.CreateBallForTest(); _setup.CreateCameraForTest(); Vector2 original = new Vector2(ball.transform.position.x, ball.transform.position.y); ball.GetComponent <Ball>().SetSpeed(1, -1); yield return(null); Vector2 current = new Vector2(ball.transform.position.x, ball.transform.position.y); Assert.AreNotEqual(original, current); }