Exemplo n.º 1
0
 public void SetupMover()
 {
     dice = new Dice();
     banker = new Banker();
     board = new Board(banker, dice);
     mover = new Mover(dice, banker, board);
     Car = new Player("Car");
 }
Exemplo n.º 2
0
        public override void LandOn(Player player)
        {
            int tenPercentOfTotalWorth = (int)System.Math.Round(player.Balance * .1, 0);

            if (tenPercentOfTotalWorth > 200)
                Banker.CreditPlayerAccount(player, 200);
            else
                Banker.CreditPlayerAccount(player, tenPercentOfTotalWorth);
        }
Exemplo n.º 3
0
        public void LandingOnGoToJailMovesPlayerToJustVisiting()
        {
            var banker = new Banker();
            var goToJail = new GoToJail("Go To Jail", 30, banker);
            Player player = new Player("Player");
            goToJail.LandOn(player);

            Assert.AreEqual(10, player.Position);
        }
Exemplo n.º 4
0
        public void LandingOnGoIncreaseBalanceByTwoHundres()
        {
            var banker = new Banker();
            var go = new Go("Go", 0, banker);
            Player player = new Player("Player");
            var playerStartingBalance = player.Balance;
            go.LandOn(player);

            Assert.AreEqual(200, player.Balance - playerStartingBalance);
        }
Exemplo n.º 5
0
        public void LandingOnLuxuryTaxDecreasesBalanceBySeventyFive()
        {
            var player = new Player("Player");
            var banker = new Banker();
            var luxuryTax = new LuxuryTax("Luxury Tax", 38, banker);
            var playerStartingBalance = player.Balance;

            luxuryTax.LandOn(player);

            Assert.AreEqual(75, playerStartingBalance - player.Balance);
        }
Exemplo n.º 6
0
        public void MovePlayerOnBoard(Player player)
        {
            var currentPosition = player.Position;
            var nextPosition = (currentPosition + spacesToMove) % 40;

            if (currentPosition > 0 && currentPosition >= nextPosition)
                banker.DebitPlayerAccount(player, 200);

            player.MovePlayer(nextPosition);
            var currentSpace = board.GetSpaceAtLocation(nextPosition);
            currentSpace.LandOn(player);
        }
Exemplo n.º 7
0
        public void CreateGameWithLMoreThanEightPlayersFail()
        {
            var three = new Player("three");
            var four = new Player("four");
            var five = new Player("five");
            var six = new Player("six");
            var seven = new Player("seven");
            var eight = new Player("eight");
            var nine = new Player("nine");

            game.AddPlayer(car);
            game.AddPlayer(horse);
            game.AddPlayer(three);
            game.AddPlayer(four);
            game.AddPlayer(five);
            game.AddPlayer(six);
            game.AddPlayer(seven);
            game.AddPlayer(eight);
            game.AddPlayer(nine);

            game.PlayGame();
        }
Exemplo n.º 8
0
 public void CreatePlayer()
 {
     Car = new Player("Car");
     Horse = new Player("Horse");
 }
Exemplo n.º 9
0
 public void SetupGameTest()
 {
     dice = new FakeDice();
     game = new Game(dice);
     horse = new Player("horse");
     car = new Player("car");
     player3 = new Player("Player 3");
 }
Exemplo n.º 10
0
 public override void LandOn(Player player)
 {
     player.MovePlayer(10);
 }
Exemplo n.º 11
0
 public void MortgagedFailsWhenOwnerDoesNotOwnTheProperty()
 {
     var player2 = new Player("Player2");
     proprietor.MortgageProperty(player, property);
 }
Exemplo n.º 12
0
 public void MovePlayerToJail(Player player)
 {
     player.Position = 10;
 }
Exemplo n.º 13
0
 public virtual void LandOn(Player player)
 {
 }
Exemplo n.º 14
0
 public void Setup()
 {
     banker = new Banker();
     incomeTax = new IncomeTax("Income Tax", 4, banker);
     player = new Player("Player");
 }
Exemplo n.º 15
0
 public void AddPlayer(Player piece)
 {
     players.Add(piece);
 }
Exemplo n.º 16
0
 public override void LandOn(Player player)
 {
     Banker.CreditPlayerAccount(player, 75);
 }
Exemplo n.º 17
0
 public Player GetNextTurn()
 {
     nextPlayer = turnOrder.ElementAt(currentPlayersTurn);
     return nextPlayer;
 }
Exemplo n.º 18
0
 public void Setup()
 {
     dice = new Dice();
     player = new Player("Player");
     player2 = new Player("Player2");
     banker = new Banker();
     proprietor = new Proprietor(banker);
     red = new List<Property>();
     property = new Property("Property", 1, 50, 10, red, banker);
     red.Add(property);
 }