Exemple #1
0
 public void Initialize()
 {
     this.fakeDice = new FakeDice();
     this.player = new Player("Horse");
     this.board = new ClassicBoard();
     this.turn = new Turn(this.fakeDice, this.player, this.board);
 }
Exemple #2
0
 public JailTests()
 {
     player = new Player("Name", 1500);
     player.BuyingStrategy = new NeverBuyStrategy();
     goToJail = new GoToJail(ClassicBoard.GoToJailLocation, ClassicBoard.JailLocation);
     dice = new FakeDice();
     turn = new Turn(dice, player, new ClassicBoard());
 }
Exemple #3
0
 public void SetUp()
 {
     var faker = new MotherFaker();
     jailRoster = faker.JailRoster;
     banker = faker.Banker;
     gameBoard = faker.GameBoard;
     dice = faker.Dice;
     PutPlayerInJail();
 }
Exemple #4
0
 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());
 }
Exemple #5
0
        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());
        }
Exemple #6
0
 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());
 }
Exemple #7
0
 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());
 }
Exemple #8
0
 private void PlayerTakesTurnRollingA(Int32 roll)
 {
     dice = new FakeDice(new[] { new FakeRoll(roll, 0) });
     var turn = new NormalTurn(playerId, dice, jailRoster, board);
     turn.Take();
 }
Exemple #9
0
        public void TestPlayerThrowsNonDoublesLandsOnGoToJailWithBalanceNotChangingAndTurnIsOver()
        {
            var fakeDice = new FakeDice(new [] { new FakeRoll(30, 0) });
            var turn = CreateTurnWith(fakeDice);
            turn.Take();

            Assert.That(banker.GetBalanceFor(playerId), Is.EqualTo(1500));
            Assert.That(board.GetLocationIndexFor(playerId), Is.EqualTo(10));
        }