private void CreateAndPlayGame(IEnumerable <Int32> playerIds) { var banker = new TraditionalBanker(playerIds); var turnFactory = new TraditionalTurnFactory(banker); game = new Game(playerIds, turnFactory); game.Play(); }
public void SetUp() { playerIds = new[] { 0, 1, 2 }; var banker = new TraditionalBanker(playerIds); turnFactory = new TraditionalTurnFactory(banker); game = new Game(playerIds, turnFactory); }
public void SetUp() { var faker = new MotherFaker(); jailRoster = faker.JailRoster; banker = faker.Banker; gameBoard = faker.GameBoard; dice = faker.Dice; PutPlayerInJail(); }
public TraditionalLocationFactory(TraditionalBanker banker, IDice dice, TraditionalJailRoster jailRoster, IBoard board, CardDeckFactory cardDeckFactory) { this.banker = banker; this.dice = dice; this.jailRoster = jailRoster; this.board = board; this.cardDeckFactory = cardDeckFactory; }
public void TestCollect50Adds50ToPlayersBalance() { var playerId = 0; var banker = new TraditionalBanker(new[] { playerId }); var collectMoneyCommand = new CollectMoneyCommand(banker, 50); collectMoneyCommand.PerformOn(playerId); Assert.That(banker.GetBalanceFor(playerId), Is.EqualTo(1550)); }
public void SetUp() { playerId = 0; var faker = new MotherFaker(); banker = faker.Banker; jailRoster = faker.JailRoster; gameBoard = faker.GameBoard; goToJail = new GoToJail(30, "Go To Jail", 10, banker, jailRoster, gameBoard); }
public void TestPayMoneyCommandFor100MakesPlayerPay100ToBank() { var playerId = 0; var banker = new TraditionalBanker(new[] { playerId }); var payMoneyCommand = new PayMoneyCommand(banker, 100); payMoneyCommand.PerformOn(playerId); Assert.That(banker.GetBalanceFor(playerId), Is.EqualTo(1400)); }
public MotherFaker() { Dice = new FakeDice(); Banker = new TraditionalBanker(new[] { 0 }); JailRoster = new TraditionalJailRoster(Banker); GameBoard = new GameBoard(Banker); var cardDeckFactory = new TraditionalCardDeckFactory(Banker, JailRoster, GameBoard, Dice); LocationFactory = new TraditionalLocationFactory(Banker, Dice, JailRoster, GameBoard, cardDeckFactory); GameBoard.SetLocations(LocationFactory.GetLocations(), LocationFactory.GetRailroads(), LocationFactory.GetUtilities()); }
public void TestGetDeckReturnsCardDeck() { var banker = new TraditionalBanker(new[] { 0, 1 }); var jailRoster = new TraditionalJailRoster(banker); var locationManager = new GameBoard(banker); var chanceFactory = new ChanceFactory(banker, jailRoster, locationManager, new FakeDice()); var deck = chanceFactory.GetCards(); Assert.That(deck.Count(), Is.EqualTo(16)); }
public void SetUp() { playerId = 0; banker = new TraditionalBanker(new[] { playerId }); jailRoster = new TraditionalJailRoster(banker); board = new GameBoard(banker); cardDeckFactory = new FakeCardDeckFactory(CreateCards()); var locationFactory = new TraditionalLocationFactory(banker, dice, jailRoster, board, cardDeckFactory); board.SetLocations(locationFactory.GetLocations(), locationFactory.GetRailroads(), locationFactory.GetUtilities()); }
public void SetUp() { banker = new TraditionalBanker(new[] { 0 }); jailRoster = new TraditionalJailRoster(banker); board = new GameBoard(banker); var dice = new FakeDice(); var cardDeckFactory = new FakeCardDeckFactory(CreateCards()); communityChest = new CardDraw(0, "Community Chest", banker, cardDeckFactory.GetCommunityChestDeck()); var traditionalLocationFactory = new TraditionalLocationFactory(banker, dice, jailRoster, board, cardDeckFactory); board.SetLocations(traditionalLocationFactory.GetLocations(), traditionalLocationFactory.GetRailroads(), traditionalLocationFactory.GetUtilities()); }
public virtual void SetUp() { playerOneId = 0; playerTwoId = 1; playerThreeId = 2; playerFourId = 3; playerFiveId = 4; banker = new TraditionalBanker(new[] { playerOneId, playerTwoId, playerThreeId, playerFourId, playerFiveId }); jailRoster = new TraditionalJailRoster(banker); gameBoard = new GameBoard(banker); dice = new FakeDice(); var cardDeckFactory = new TraditionalCardDeckFactory(banker, jailRoster, gameBoard, dice); var locationFactory = new TraditionalLocationFactory(banker, dice, jailRoster, gameBoard, cardDeckFactory); gameBoard.SetLocations(locationFactory.GetLocations(), locationFactory.GetRailroads(), locationFactory.GetUtilities()); }
public void SetUp() { banker = new TraditionalBanker(new[] { 0, 1 }); }
public TraditionalTurnFactory(TraditionalBanker banker) { this.banker = banker; board = CreateBoard(); }
public void SetUp() { playerId = 0; banker = new TraditionalBanker(new[] { playerId }); jailRoster = new TraditionalJailRoster(banker); }