Пример #1
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;
        }
Пример #2
0
        public void TakeAWalkOnTheBoardwalkMovesPlayerToBoardwalk()
        {
            var moveToBoardwalk = new Advance(board, banker, 39);
            moveToBoardwalk.Play(player1);

            Assert.That(board.GetPosition(player1), Is.EqualTo(39));
        }
Пример #3
0
        public void GoToReadingRailroadShouldPayThePlayer200()
        {
            board.MoveTo(player1, 5);
            board.MoveTo(player1, 36);
            var rideTheReading = new Advance(board, banker, 5);
            var previousBalance = banker.GetBalance(player1);

            rideTheReading.Play(player1);

            Assert.That(banker.GetBalance(player1), Is.EqualTo(previousBalance + 200));
        }