public void PlayerAttack() { var stubGameController = new StubGameController(); var playerController = new PlayerController(stubGameController); var player1 = new Player(new StubPlayerView(), new PlayerModel(), 1); var player2 = new Player(new StubPlayerView(), new PlayerModel(), 2); playerController.InitPlayers(new List <Player>() { player1, player2 }); playerController.OnAttack(2, 50); Assert.True(player1.PlayerModel.Health < 100); }
public IEnumerator AddPlayerGameObjects() { var playerPrefab = Resources.Load <GameObject>("Prefabs/Player_mock"); GameObject.Instantiate(playerPrefab); var mainScript = new MainScript(); var stubGameController = new StubGameController(); var stubPlayerController = new StubPlayerController(); var stubStatController = new StubStatController(); mainScript.Construct(stubGameController, stubPlayerController, stubStatController); mainScript.StartGame(new List <IPlayerView>() { playerPrefab.GetComponent <StubPlayerView>() }); Assert.IsTrue(stubGameController.Players.Count > 0 && stubPlayerController.Players.Count > 0); yield return(null); }