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 void notToPenaltyBoxAfterCorrectAnswer() { Game g = createGameWithTwoPlayers(); g.Roll(2); g.MarkCurrentAnswerAsCorrectAndMoveToNextPlayer(); Assert.IsFalse(g.IsPreviousPlayerInPenaltyBox()); }
public void getsCoinAfterCorrectAnswer() { Game g = createGameWithTwoPlayers(); g.Roll(5); Assert.That(g.playerCoins [0], Is.EqualTo(0)); g.MarkCurrentAnswerAsCorrectAndMoveToNextPlayer(); Assert.That(g.playerCoins [0], Is.EqualTo(1)); }
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 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); }
private bool rollAndGiveCorrectAnswer(Game g) { g.Roll(4); return(g.MarkCurrentAnswerAsCorrectAndMoveToNextPlayer()); }