Ejemplo n.º 1
0
        public void AdvanceToUtility_UtilityUnowned_ShouldMovePlayerToWaterWorksAndPurchase()
        {
            Board            board     = new CardBoard();
            AdvanceToUtility advToUtil = new AdvanceToUtility();

            advToUtil.BoardReference = board;
            Player horse = new Player("Horse");

            horse.Bank = 500;
            board.AddPlayerToBoard(horse, 0);

            advToUtil.Execute(horse);

            Assert.Equal(350, horse.Bank);
            Assert.Equal(8, horse.Position);
        }
Ejemplo n.º 2
0
        public void AdvanceToUtility_UtilityOwned_ShouldMovePlayerToWaterWorksAndPayRent()
        {
            Board            board     = new CardBoard();
            AdvanceToUtility advToUtil = new AdvanceToUtility();

            advToUtil.BoardReference = board;
            Player horse = new Player("Horse");
            Player car   = new Player("Car");

            car.Bank = 2000;
            board.AddPlayerToBoard(car, 0);
            board.AddPlayerToBoard(horse, 0);

            board.Move(car, 8);

            horse.LastRoll = (6, 6);
            advToUtil.Execute(horse);

            Assert.True((horse.Bank > -120) && (horse.Bank <= -20));
            Assert.Equal(8, horse.Position);
        }