Slide 111
Slide 111 text
111
Dependency Injections
public class PlayerTest {
[UnityTest]
public IEnumerator MovePositionTest() {
var go = new GameObject();
var player = go.AddComponent();
yield return new WaitForEndOfFrame(); // 初期化待ち
player.transform.position = Vector3.zero;
player.SetInput(new TestInput()); // Dependency Injection
yield return new WaitForEndOfFrame();
Assert.AreEqual(new Vector3(1f, 0f, 1f), player.transform.position);
}
}
͓·͚
ςετίʔυͪ͜Β