Пример #1
0
        public void TestInitialize()
        {
            player    = new Player("player");
            banker    = new Banker();
            luxuryTax = new LuxuryTax(2, banker, "LuxuryTax");

            banker.AddAccount(player, 500);
        }
Пример #2
0
        public void PlayerVisitsLuxuryTax_NothingHappens()
        {
            var luxuryTax     = new LuxuryTax(38, banker, "Luxury Tax");
            var cashBeforeTax = banker.GetPlayerBalance(player);

            luxuryTax.Visit(player);

            Assert.AreEqual(0, banker.GetPlayerBalance(player) - cashBeforeTax);
            Assert.AreEqual(38, player.Location);
        }
Пример #3
0
        private void InitializeLocations()
        {
            Locations = new List <ILocation>();

            for (int i = 0; i < 40; i++)
            {
                Locations.Add(new GenericLocation());
            }

            Locations[4]  = new IncomeTax();
            Locations[30] = new GoToJail();
            Locations[38] = new LuxuryTax();
        }
        public void LuxuryTaxTest()
        {
            var player = new Player("name");

            var banker    = new Banker(new[] { player });
            var luxuryTax = new LuxuryTax(banker);

            var playerMoney = banker.Money[player];

            luxuryTax.LandOn(player);

            Assert.AreEqual(playerMoney - LuxuryTax.LUXURY_TAX, banker.Money[player]);
        }
Пример #5
0
        protected override void CreateBoardComponents()
        {
            var go = new Go(GoLocation, GoSalaryBonus);
            var mediterraneanAvenue  = new Property(MediterraneanAvenueLocation, MediterraneanAvenuePrice, MediterraneanAvenueRent);
            var communityChestOne    = new CommunityChest(CommunityChestOneLocation);
            var balticAvenue         = new Property(BalticAvenueLocation, BalticAvenuePrice, BalticAvenueRent);
            var incomeTax            = new IncomeTax(IncomeTaxLocation, IncomeTaxPercentage, MaximumIncomeTaxPaymentAmount);
            var readingRailrod       = new Property(ReadingRailroadLocation, RailroadPrice, BaseRailroadRent);
            var orientalAvenue       = new Property(OrientalAvenueLocation, OrientalAvenuePrice, OrientalAvenueRent);
            var chanceOne            = new Chance(ChanceOneLocation);
            var vermontAvenue        = new Property(VermontAvenueLocation, VermontAvenuePrice, VermontAvenueRent);
            var connecticutAvenue    = new Property(ConnecticutAvenueLocation, ConnecticutAvenuePrice, ConnecticutAvenueRent);
            var justVisiting         = new Location(JustVisitingLocation);
            var stCharlesPlace       = new Property(StCharlesPlaceLocation, StCharlesPlacePrice, StCharlesPlaceRent);
            var electricCompany      = new Property(ElectricCompanyLocation, UtilityPrice, 0);
            var statesAvenue         = new Property(StatesAvenueLocation, StatesAvenuePrice, StatesAvenueRent);
            var virginiaAvenue       = new Property(VirginiaAvenueLocation, VirginiaAvenuePrice, VirginiaAvenueRent);
            var pennsylvaniaRailroad = new Property(PennsylvaniaRailroadLocation, RailroadPrice, BaseRailroadRent);
            var stJamesPlace         = new Property(StJamesPlaceLocation, StJamesPlacePrice, StJamesPlaceRent);
            var communityChestTwo    = new CommunityChest(CommunityChestTwoLocation);
            var tennesseeAvenue      = new Property(TennesseeAvenueLocation, TennesseeAvenuePrice, TennesseeAvenueRent);
            var newYorkAvenue        = new Property(NewYorkAvenueLocation, NewYorkAvenuePrice, NewYorkAvenueRent);
            var freeParking          = new Location(FreeParkingLocation);
            var kentuckyAvenue       = new Property(KentuckyAvenueLocation, KentuckyAvenuePrice, KentuckyAvenueRent);
            var chanceTwo            = new Chance(ChanceTwoLocation);
            var indianaAvenue        = new Property(IndianaAvenueLocation, IndianaAvenuePrice, IndianaAvenueRent);
            var illinoisAvenue       = new Property(IllinoisAvenueLocation, IllinoisAvenuePrice, IllinoisAvenueRent);
            var boRailroad           = new Property(BORailroadLocation, RailroadPrice, BaseRailroadRent);
            var atlanticAvenue       = new Property(AtlanticAvenueLocation, AtlanticAvenuePrice, AtlanticAvenueRent);
            var ventnorAvenue        = new Property(VentnorAvenueLocation, VentnorAvenuePrice, VentnorAvenueRent);
            var waterWorks           = new Property(WaterWorksLocation, UtilityPrice, 0);
            var marvinGardens        = new Property(MarvinGardensLocation, MarvinGardensPrice, MarvinGardensRent);
            var goToJail             = new GoToJail(GoToJailLocation, JustVisitingLocation);
            var pacificAvenue        = new Property(PacificAvenueLocation, PacificAvenuePrice, PacificAvenueRent);
            var northCarolinaAvenue  = new Property(NorthCarolinaAvenueLocation, NorthCarolinaAvenuePrice, NorthCarolinaAvenueRent);
            var communityChestThree  = new CommunityChest(CommunityChestThreeLocation);
            var pennsylvaniaAvenue   = new Property(PennsylvaniaAvenueLocation, PennsylvaniaAvenuePrice, PennsylvaniaAvenueRent);
            var shortLine            = new Property(ShortLineLocation, RailroadPrice, BaseRailroadRent);
            var chanceThree          = new Chance(ChanceThreeLocation);
            var parkPlace            = new Property(ParkPlaceLocation, ParkPlacePrice, ParkPlaceRent);
            var luxuryTax            = new LuxuryTax(LuxuryTaxLocation, LuxuryTaxPaymentAmount);
            var boardwalk            = new Property(BoardwalkLocation, BoardwalkPrice, BoardwalkRent);

            var classicPropertyRentStrategy = new ClassicPropertyRentStrategy();

            var purpleGroup    = new PropertyGroup(classicPropertyRentStrategy, mediterraneanAvenue, balticAvenue);
            var lightBlueGroup = new PropertyGroup(classicPropertyRentStrategy, orientalAvenue, vermontAvenue, connecticutAvenue);
            var violetGroup    = new PropertyGroup(classicPropertyRentStrategy, stCharlesPlace, statesAvenue, virginiaAvenue);
            var orangeGroup    = new PropertyGroup(classicPropertyRentStrategy, stJamesPlace, tennesseeAvenue, newYorkAvenue);
            var redGroup       = new PropertyGroup(classicPropertyRentStrategy, kentuckyAvenue, indianaAvenue, illinoisAvenue);
            var yellowGroup    = new PropertyGroup(classicPropertyRentStrategy, atlanticAvenue, ventnorAvenue, marvinGardens);
            var darkGreenGroup = new PropertyGroup(classicPropertyRentStrategy, pacificAvenue, northCarolinaAvenue, pennsylvaniaAvenue);
            var darkBlueGroup  = new PropertyGroup(classicPropertyRentStrategy, parkPlace, boardwalk);
            var railroadGroup  = new PropertyGroup(new ClassicRailroadRentStrategy(), readingRailrod, pennsylvaniaRailroad, boRailroad, shortLine);
            var utilityGroup   = new PropertyGroup(new ClassicUtilityRentStrategy(), electricCompany, waterWorks);

            boardComponents = new List <BoardComponent>();
            boardComponents.Add(purpleGroup);
            boardComponents.Add(lightBlueGroup);
            boardComponents.Add(violetGroup);
            boardComponents.Add(orangeGroup);
            boardComponents.Add(redGroup);
            boardComponents.Add(yellowGroup);
            boardComponents.Add(darkGreenGroup);
            boardComponents.Add(darkBlueGroup);
            boardComponents.Add(railroadGroup);
            boardComponents.Add(utilityGroup);
            boardComponents.Add(go);
            boardComponents.Add(goToJail);
            boardComponents.Add(incomeTax);
            boardComponents.Add(luxuryTax);
            boardComponents.Add(justVisiting);
            boardComponents.Add(freeParking);
            boardComponents.Add(communityChestOne);
            boardComponents.Add(communityChestTwo);
            boardComponents.Add(communityChestThree);
            boardComponents.Add(chanceOne);
            boardComponents.Add(chanceTwo);
            boardComponents.Add(chanceThree);
        }
Пример #6
0
 public LuxuryTaxTests()
 {
     luxuryTax        = new LuxuryTax(ClassicBoard.LuxuryTaxLocation, ClassicBoard.LuxuryTaxPaymentAmount);
     currentDiceValue = 7;
 }