public void SetupMover() { dice = new Dice(); banker = new Banker(); board = new Board(banker, dice); mover = new Mover(dice, banker, board); Car = new Player("Car"); }
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); }
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); }
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); }
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); }
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); }
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(); }
public void CreatePlayer() { Car = new Player("Car"); Horse = new Player("Horse"); }
public void SetupGameTest() { dice = new FakeDice(); game = new Game(dice); horse = new Player("horse"); car = new Player("car"); player3 = new Player("Player 3"); }
public override void LandOn(Player player) { player.MovePlayer(10); }
public void MortgagedFailsWhenOwnerDoesNotOwnTheProperty() { var player2 = new Player("Player2"); proprietor.MortgageProperty(player, property); }
public void MovePlayerToJail(Player player) { player.Position = 10; }
public virtual void LandOn(Player player) { }
public void Setup() { banker = new Banker(); incomeTax = new IncomeTax("Income Tax", 4, banker); player = new Player("Player"); }
public void AddPlayer(Player piece) { players.Add(piece); }
public override void LandOn(Player player) { Banker.CreditPlayerAccount(player, 75); }
public Player GetNextTurn() { nextPlayer = turnOrder.ElementAt(currentPlayersTurn); return nextPlayer; }
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); }