Exemplo n.º 1
0
        public void GoBack3SpacesMovesThePlayerBackwards3Spaces()
        {
            board.MoveTo(player1, 28);
            var goBack3Spaces = new GoBackSpaces(board, 3);

            goBack3Spaces.Play(player1);

            Assert.That(board.GetPosition(player1), Is.EqualTo(25));
        }
Exemplo n.º 2
0
        private Queue<ICard> CreateChanceCards(Banker banker, Board board, PrisonGuard guard, UtilityRentStrategy utilityRentStrtegy, RailroadRentStrategy railroadRentStrategy)
        {
            var bankDividend = new Collect(banker, 50);
            var maturedLoan = new Collect(banker, 150);
            var poorTax = new Pay(banker, 15);

            var moveToBoardwalk = new Advance(board, banker, 39);
            var rideTheReading = new Advance(board, banker, 5);
            var moveToIllinois = new Advance(board, banker, 24);
            var moveToStCharles = new Advance(board, banker, 11);
            var moveToNearestRailroad = new AdvanceToNearest(board, new[] { 5, 15, 25, 35 }, railroadRentStrategy);
            var MoveToNearest = new AdvanceToNearest(board, new[] { 12, 28 }, utilityRentStrtegy);
            var goBack3Spaces = new GoBackSpaces(board, 3);

            var chairmanOfTheboard = new PayEachPlayer(banker, 50);
            var goToJail = new AdvanceTo(board, 30);
            var advanceToGo = new AdvanceTo(board, 0);
            var getOutofJailFree = new GetOutOfJailFree(guard);

            var cards = new Queue<ICard>();
            cards.Enqueue(bankDividend);
            cards.Enqueue(maturedLoan);
            cards.Enqueue(poorTax);
            cards.Enqueue(moveToNearestRailroad);
            cards.Enqueue(moveToBoardwalk);
            cards.Enqueue(chairmanOfTheboard);
            cards.Enqueue(moveToNearestRailroad);
            cards.Enqueue(rideTheReading);
            cards.Enqueue(moveToIllinois);
            cards.Enqueue(moveToStCharles);
            cards.Enqueue(goToJail);
            cards.Enqueue(advanceToGo);
            cards.Enqueue(getOutofJailFree);

            return cards;
        }
Exemplo n.º 3
0
        public void GoBack3SpacesShouldNotPayThePlayer200Dollars()
        {
            board.MoveTo(player1, 13);
            var goBack3Spaces = new GoBackSpaces(board, 3);
            var previousBalance = banker.GetBalance(player1);

            goBack3Spaces.Play(player1);

            Assert.That(banker.GetBalance(player1), Is.LessThanOrEqualTo(previousBalance));
        }