public void TestBoard() { CellFactory factory = new CircularClosedCellFactory(); //string input = "E,E,J,H,E,T,J,T,E,E,H,J,T,H,E,E,J,H,E,T,J,T,E,E,H,J,T,H,J,E,E,J,H,E,T,J,T,E,E,H,J,T,E,H,E"; //string outComes = "4,4,4,6,7,8,5,11,10,12,2,3,5,6,7,8,5,11,10,12,2,3,5,6,7,8,5,11,10,12"; string input = "E,E,J,H,E,T,J"; string outComes = "1,1,2,1,2,3"; Board board = new Board(factory, input); Dice dice = new Dice(outComes); GameRules gameRule = new GameRules { MaxMovesPerPlayer = 3, MinimumPlayerCount = 2 }; MonopolyGame game = new MonopolyGame(board, dice, gameRule); Player p1 = new Player(1, 1000, board.StartCell); Player p2 = new Player(2, 1000, board.StartCell); game.AddPlayer(p1); game.AddPlayer(p2); string outCome = game.StartGame(); Assert.IsTrue(board.GetCurrentCellIndex(p1.CurrentCell) == 6); Assert.IsTrue(board.GetCurrentCellIndex(p2.CurrentCell) == 6); Assert.IsTrue(p1.GetTotalWorth() == 1200); Assert.IsTrue(p2.GetTotalWorth() == 1050); }
public void TestInitialize() { _game = new MonopolyGame(BoardBuilderHelper.GetBoardBuilder()); _game.AddPlayer("Car"); _player = _game.GetPlayers().Single(); _initialCash = _player.Cash; _target = new GiveToAllPlayers(_game, Amount); }
public void GiveToAllPlayersOneOtherPlayerTest() { _game.AddPlayer("Horse"); _target.Execute(_player); var expected = _initialCash + Amount; foreach (var player in _game.GetPlayers().Where(p => p != _player)) { Assert.AreEqual(expected, player.Cash); } Assert.AreEqual(GetExpectedReducedCash(), _player.Cash); }