public UtilityTests()
        {
            dice = new Dice();
            hat = "Hat";

            var banker = new Banker(new[] { hat });
            var propertyManager = new PropertyManager();
            electricCompany = new Utility(
                ClassicBoardFactory.ElectricCompanyIndex,
                ClassicBoardFactory.UtilityPrice,
                ClassicBoardFactory.UtilityGroup,
                banker,
                propertyManager,
                dice);

            waterWorks = new Utility(
                ClassicBoardFactory.WaterWorksIndex,
                ClassicBoardFactory.UtilityPrice,
                ClassicBoardFactory.UtilityGroup,
                banker,
                propertyManager,
                dice);

            propertyManager.ManageProperties(new[] { electricCompany, waterWorks });
        }
 public Property(Int32 index, Int32 price, Int32 baseRent, String group, Banker banker, PropertyManager propertyManager)
     : base(index)
 {
     this.price = price;
     this.baseRent = baseRent;
     this.group = group;
     this.banker = banker;
     this.propertyManager = propertyManager;
 }
 public PropertyManagerTests()
 {
     horse = "Horse";
     hat = "Hat";
     var banker = new Banker(new[] { horse, hat });
     propertyManager = new PropertyManager();
     properties = ClassicBoardFactory.CreateProperties(banker, propertyManager);
     propertyManager.ManageProperties(properties);
 }
        public static Game Create(IEnumerable<String> players)
        {
            var dice = new Dice();
            var banker = new Banker(players);
            var propertyManager = new PropertyManager();
            var properties = ClassicBoardFactory.CreateProperties(banker, propertyManager);
            propertyManager.ManageProperties(properties);

            var board = ClassicBoardFactory.CreateBoard(dice, new[] { new ClassicGoBonusRule(banker) }, properties, banker, players);
            var turnTaker = new ClassicTurn(dice, board, banker, propertyManager);

            return new Game(players, turnTaker, new GuidShuffler<String>());
        }
        public void Initialize()
        {
            mockDice = new Mock<Dice>();
            mockDice.Setup(m => m.RollDie()).Returns(() => dieValues.Dequeue());
            horse = "Horse";
            banker = new Banker(new[] { horse });

            var propertyManager = new PropertyManager();
            properties = ClassicBoardFactory.CreateProperties(banker, propertyManager);
            propertyManager.ManageProperties(properties);

            mockBoard = new Mock<IBoard>();
            turn = new ClassicTurn(mockDice.Object, mockBoard.Object, banker, propertyManager);
        }
        public RailroadTests()
        {
            hat = "Hat";
            horse = "Horse";
            banker = new Banker(new[] { hat, horse });

            var propertyManager = new PropertyManager();
            readingRailroad = new Railroad(
                ClassicBoardFactory.ReadingRailroadIndex,
                ClassicBoardFactory.RailroadPrice,
                ClassicBoardFactory.BaseRailroadRent,
                ClassicBoardFactory.RailroadGroup,
                banker,
                propertyManager);

            pennsylvaniaRailroad = new Railroad(
                ClassicBoardFactory.PennsylvaniaRailroadIndex,
                ClassicBoardFactory.RailroadPrice,
                ClassicBoardFactory.BaseRailroadRent,
                ClassicBoardFactory.RailroadGroup,
                banker,
                propertyManager);

            boRailroad = new Railroad(
                ClassicBoardFactory.BoRailroadIndex,
                ClassicBoardFactory.RailroadPrice,
                ClassicBoardFactory.BaseRailroadRent,
                ClassicBoardFactory.RailroadGroup,
                banker,
                propertyManager);

            shortLine = new Railroad(
                ClassicBoardFactory.IncomeTaxIndex,
                ClassicBoardFactory.RailroadPrice,
                ClassicBoardFactory.BaseRailroadRent,
                ClassicBoardFactory.RailroadGroup,
                banker,
                propertyManager);

            propertyManager.ManageProperties(new[] { readingRailroad, pennsylvaniaRailroad, boRailroad, shortLine });
        }
        public static IEnumerable<Property> CreateProperties(Banker banker, PropertyManager propertyManager)
        {
            var mediterraneanAvenue = new Property(MediterraneanAvenueIndex, MediterraneanAvenuePrice, MediterraneanAvenueRent, PurpleGroup, banker, propertyManager);
            var balticAvenue = new Property(BalticAvenueIndex, BalticAvenuePrice, BalticAvenueRent, PurpleGroup, banker, propertyManager);
            var readingRailroad = new Property(ReadingRailroadIndex, RailroadPrice, BaseRailroadRent, RailroadGroup, banker, propertyManager);
            var orientalAvenue = new Property(OrientalAvenueIndex, OrientalAvenuePrice, OrientalAvenueRent, LightBlueGroup, banker, propertyManager);
            var vermontAvenue = new Property(VermontAvenueIndex, VermontAvenuePrice, VermontAvenueRent, LightBlueGroup, banker, propertyManager);
            var connecticutAvenue = new Property(ConnecticutAvenueIndex, ConnecticutAvenuePrice, ConnecticutAvenueRent, LightBlueGroup, banker, propertyManager);
            var stCharlesPlace = new Property(StCharlesPlaceIndex, StCharlesPlacePrice, StCharlesPlaceRent, VioletGroup, banker, propertyManager);
            var electricCompany = new Property(ElectricCompanyIndex, UtilityPrice, 0, UtilityGroup, banker, propertyManager);
            var statesAvenue = new Property(StatesAvenueIndex, StatesAvenuePrice, StatesAvenueRent, VioletGroup, banker, propertyManager);
            var virginiaAvenue = new Property(VirginiaAvenueIndex, VirginiaAvenuePrice, VirginiaAvenueRent, VioletGroup, banker, propertyManager);
            var pennsylvaniaRailroad = new Property(PennsylvaniaRailroadIndex, RailroadPrice, BaseRailroadRent, RailroadGroup, banker, propertyManager);
            var stJamesPlace = new Property(StJamesPlaceIndex, StJamesPlacePrice, StJamesPlaceRent, OrangeGroup, banker, propertyManager);
            var tennesseeAvenue = new Property(TennesseeAvenueIndex, TennesseeAvenuePrice, TennesseeAvenueRent, OrangeGroup, banker, propertyManager);
            var newYorkAvenue = new Property(NewYorkAvenueIndex, NewYorkAvenuePrice, NewYorkAvenueRent, OrangeGroup, banker, propertyManager);
            var kentuckyAvenue = new Property(KentuckyAvenueIndex, KentuckyAvenuePrice, KentuckyAvenueRent, RedGroup, banker, propertyManager);
            var indianaAvenue = new Property(IndianaAvenueIndex, IndianaAvenuePrice, IndianaAvenueRent, RedGroup, banker, propertyManager);
            var illinoisAvenue = new Property(IllinoisAvenueIndex, IllinoisAvenuePrice, IllinoisAvenueRent, RedGroup, banker, propertyManager);
            var boRailroad = new Property(BoRailroadIndex, RailroadPrice, BaseRailroadRent, RailroadGroup, banker, propertyManager);
            var atlanticAvenue = new Property(AtlanticAvenueIndex, AtlanticAvenuePrice, AtlanticAvenueRent, YellowGroup, banker, propertyManager);
            var ventnorAvenue = new Property(VentnorAvenueIndex, VentnorAvenuePrice, VentnorAvenueRent, YellowGroup, banker, propertyManager);
            var waterWorks = new Property(WaterWorksIndex, UtilityPrice, 0, UtilityGroup, banker, propertyManager);
            var marvinGardens = new Property(MarvinGardensIndex, MarvinGardensPrice, MarvinGardensRent, YellowGroup, banker, propertyManager);
            var pacificAvenue = new Property(PacificAvenueIndex, PacificAvenuePrice, PacificAvenueRent, DarkGreenGroup, banker, propertyManager);
            var northCarolinaAvenue = new Property(NorthCarolinaAvenueIndex, NorthCarolinaAvenuePrice, NorthCarolinaAvenueRent, DarkGreenGroup, banker, propertyManager);
            var pennsylvaniaAvenue = new Property(PennsylvaniaAvenueIndex, PennsylvaniaAvenuePrice, PennsylvaniaAvenueRent, DarkGreenGroup, banker, propertyManager);
            var shortLine = new Property(ShortLineIndex, RailroadPrice, BaseRailroadRent, RailroadGroup, banker, propertyManager);
            var parkPlace = new Property(ParkPlaceIndex, ParkPlacePrice, ParkPlaceRent, DarkBlueGroup, banker, propertyManager);
            var boardwalk = new Property(BoardwalkIndex, BoardwalkPrice, BoardwalkRent, DarkBlueGroup, banker, propertyManager);

            var properties = new List<Property>();
            properties.Add(mediterraneanAvenue);
            properties.Add(balticAvenue);
            properties.Add(readingRailroad);
            properties.Add(orientalAvenue);
            properties.Add(vermontAvenue);
            properties.Add(connecticutAvenue);
            properties.Add(stCharlesPlace);
            properties.Add(electricCompany);
            properties.Add(statesAvenue);
            properties.Add(virginiaAvenue);
            properties.Add(pennsylvaniaRailroad);
            properties.Add(stJamesPlace);
            properties.Add(tennesseeAvenue);
            properties.Add(newYorkAvenue);
            properties.Add(kentuckyAvenue);
            properties.Add(indianaAvenue);
            properties.Add(illinoisAvenue);
            properties.Add(boRailroad);
            properties.Add(atlanticAvenue);
            properties.Add(ventnorAvenue);
            properties.Add(waterWorks);
            properties.Add(marvinGardens);
            properties.Add(pacificAvenue);
            properties.Add(northCarolinaAvenue);
            properties.Add(pennsylvaniaAvenue);
            properties.Add(shortLine);
            properties.Add(parkPlace);
            properties.Add(boardwalk);

            return properties;
        }