Exemplo n.º 1
0
        public void OnScoreWon()
        {
            var logic = new ScoreBoardLogic(yourScore, opponentScore, centerMessage);

            logic.OnScore(PlayerScore.WinningScore, true);

            StringAssert.Contains(PlayerScore.WinningScore.ToString(), yourScore.text);
            StringAssert.Contains("WIN", centerMessage.text);
        }
Exemplo n.º 2
0
        public void OnScoreLost()
        {
            var logic = new ScoreBoardLogic(yourScore, opponentScore, centerMessage);

            logic.OnScore(PlayerScore.WinningScore, false);

            StringAssert.Contains(PlayerScore.WinningScore.ToString(), opponentScore.text);
            StringAssert.Contains("LOSE", centerMessage.text);
        }
Exemplo n.º 3
0
        public void OnScoreNotWonOrLost()
        {
            var logic = new ScoreBoardLogic(yourScore, opponentScore, centerMessage);

            for (var i = 0; i <= 1; i++)
            {
                for (var y = 0; y < PlayerScore.WinningScore; y++)
                {
                    var isPlayerLocal = i == 0;
                    logic.OnScore(y, isPlayerLocal);
                    var check = isPlayerLocal ? yourScore : opponentScore;

                    Assert.AreEqual(centerMessage.text, "");
                    StringAssert.Contains(y.ToString(), check.text);
                }
            }
        }