public void GrandOperaLetsThePlayerCollect50DollarsFromEachPlayer()
        {
            var player2 = "Car";
            var player3 = "Dog";
            players.AddRange(new[] { player2, player3 });
            banker = new Banker(players, 1500);
            var grandOpera = new CollectFromEachPlayer(banker, 50);
            var previousBalance = banker.GetBalance(player1);

            grandOpera.Play(player1);

            Assert.That(banker.GetBalance(player1), Is.EqualTo(previousBalance + 100));
        }
Пример #2
0
        private Queue<ICard> CreateCommunityChestCards(Banker banker, Board board, PrisonGuard guard)
        {
            var christmasFund = new Collect(banker, 100);
            var inheritance = new Collect(banker, 100);
            var soldStock = new Collect(banker, 45);
            var bankError = new Collect(banker, 200);
            var receiveForServices = new Collect(banker, 25);
            var beautyContestWinnings = new Collect(banker, 10);
            var taxRefund = new Collect(banker, 20);
            var lifeInsurance = new Collect(banker, 100);

            var hospitalBill = new Pay(banker, 100);
            var doctorsFee = new Pay(banker, 50);
            var schoolTax = new Pay(banker, 150);

            var grandOpera = new CollectFromEachPlayer(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(christmasFund);
            cards.Enqueue(inheritance);
            cards.Enqueue(soldStock);
            cards.Enqueue(bankError);
            cards.Enqueue(receiveForServices);
            cards.Enqueue(beautyContestWinnings);
            cards.Enqueue(taxRefund);
            cards.Enqueue(lifeInsurance);
            cards.Enqueue(hospitalBill);
            cards.Enqueue(doctorsFee);
            cards.Enqueue(schoolTax);
            cards.Enqueue(grandOpera);
            cards.Enqueue(goToJail);
            cards.Enqueue(advanceToGo);
            cards.Enqueue(getOutOfJailFree);

            return cards;
        }