Esempio n. 1
0
        public void TestLandedOnSendsPlayerToJail()
        {
            goToJail.LandedOnBy(playerId);

            Assert.That(banker.GetBalanceFor(playerId), Is.EqualTo(1500));
            Assert.That(jailRoster.IsInJail(playerId), Is.True);
            Assert.That(gameBoard.GetLocationIndexFor(playerId), Is.EqualTo(10));
        }
Esempio n. 2
0
        public void TestPlayerLandsOnPicksTopCardAndPlaysThenPutsOnBottomOfDeck()
        {
            communityChest.LandedOnBy(0);

            Assert.That(jailRoster.IsInJail(0), Is.True);
            Assert.That(banker.GetBalanceFor(0), Is.EqualTo(1500));

            communityChest.LandedOnBy(0);
            Assert.That(banker.GetBalanceFor(0), Is.EqualTo(1550));
        }
Esempio n. 3
0
 public Turn GetTurnFor(Int32 playerId)
 {
     if (jailRoster.IsInJail(playerId))
     {
         return(new InmateTurn(playerId, dice, jailRoster, board));
     }
     else
     {
         return(new NormalTurn(playerId, dice, jailRoster, board));
     }
 }
Esempio n. 4
0
        public void TestPlayerRollsDoublesOnCommunityChestGoingToJailAndDoesNotRollAgain()
        {
            var rolls = new[]
            {
                new FakeRoll(1, 1),
                new FakeRoll(3, 2)
            };
            var cards = new[]
            {
                new Card(new GoDirectlyToJailCommand(jailRoster, board)),
                new Card(new CollectMoneyCommand(banker, 100))
            };
            var turn = CreateTurnWithSpecificCards(new FakeDice(rolls), cards);

            turn.Take();

            Assert.That(banker.GetBalanceFor(playerId), Is.EqualTo(1500));
            Assert.That(jailRoster.IsInJail(playerId), Is.True);
            Assert.That(board.GetLocationIndexFor(playerId), Is.EqualTo(10));
        }
Esempio n. 5
0
 public void TestJailRosterReturnsTrueWhenPlayerIsInJail()
 {
     jailRoster.Add(playerId);
     Assert.That(jailRoster.IsInJail(playerId), Is.True);
 }