public void toPenaltyBoxAfterWrongAnswer() { Game game = createGameWithTwoPlayers(); game.Roll(4); game.MarkCurrentAnswerAsIncorrectAndMoveToNextPlayer(); Assert.That(game.IsPreviousPlayerInPenaltyBox(), Is.True); }
public void doesNotGetCoinAfterWrongAnswer() { Game g = createGameWithTwoPlayers(); g.Roll(5); Assert.AreEqual(0, g.playerCoins [0]); g.MarkCurrentAnswerAsIncorrectAndMoveToNextPlayer(); Assert.AreEqual(0, g.playerCoins [0]); }
public void advancesPlayerAfterAnswer() { Game g = createGameWithTwoPlayers(); Assert.That(g.currentPlayerIndex, Is.EqualTo(0)); g.Roll(5); g.MarkCurrentAnswerAsCorrectAndMoveToNextPlayer(); Assert.That(g.currentPlayerIndex, Is.EqualTo(1)); g.Roll(3); g.MarkCurrentAnswerAsIncorrectAndMoveToNextPlayer(); Assert.That(g.currentPlayerIndex, Is.EqualTo(0)); }
public void notOutOfPenaltyBoxAfterEvenRoll() { Game g = createGameWithTwoPlayers(); g.Roll(2); g.MarkCurrentAnswerAsIncorrectAndMoveToNextPlayer(); Assert.IsTrue(g.IsPreviousPlayerInPenaltyBox()); g.Roll(3); g.MarkCurrentAnswerAsCorrectAndMoveToNextPlayer(); g.Roll(2); g.MarkCurrentAnswerAsCorrectAndMoveToNextPlayer(); Assert.IsTrue(g.IsPreviousPlayerInPenaltyBox()); }
public static void Main(String[] args) { Game aGame = new Game(); aGame.Add("Chet"); aGame.Add("Pat"); aGame.Add("Sue"); Random rand = new Random(); do { aGame.Roll(rand.Next(5) + 1); if (rand.Next(9) == 7) { notAWinner = aGame.MarkCurrentAnswerAsIncorrectAndMoveToNextPlayer(); } else { notAWinner = aGame.MarkCurrentAnswerAsCorrectAndMoveToNextPlayer(); } } while (notAWinner); }