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]); }
public void Land() { var space = new LandableSpace(); var spaces = new Dictionary<Int32, UnownableSpace>(); spaces.Add(0, space); var handler = new UnownableHandler(spaces); var player = new Player("name"); handler.Land(player, 0); Assert.IsTrue(space.LandedOn); }
public void TestHorsePlayerDoesNotEqualCarPlayer() { var car = new Player(0, "Car"); Assert.That(player.Equals(car), Is.False); }
public void SetUp() { player = new Player(0, "Horse"); }
public void TestTwoPlayersInJailAndGetTurnsReturnsCorrectly() { var player2 = new Player(1, "car"); jailRoster.Add(playerId); jailRoster.Add(player2.Id); jailRoster.AddTurnFor(playerId); jailRoster.AddTurnFor(playerId); jailRoster.AddTurnFor(player2.Id); Assert.That(jailRoster.GetTurnsFor(playerId), Is.EqualTo(2)); Assert.That(jailRoster.GetTurnsFor(player2.Id), Is.EqualTo(1)); }
private Boolean Equals(Player other) { return Token == other.Token && Id == other.Id; }
public void Setup() { player = new Player("name"); player.OwnableStrategy = new RandomlyBuyOrMortgage(); var owner = new Player("owner"); owner.OwnableStrategy = new RandomlyBuyOrMortgage(); var players = new[] { player, owner }; var dice = new ControlledDice(); var realEstate = BoardFactory.CreateRealEstate(dice); banker = new Banker(players); var realEstateHandler = new OwnableHandler(realEstate, banker); boardHandler = FakeHandlerFactory.CreateBoardHandlerForFakeBoard(players, realEstateHandler, banker); foreach (var rxr in realEstate.Values.OfType<Railroad>()) realEstateHandler.Land(owner, realEstate.Keys.First(k => realEstate[k] == rxr)); railroadCard = new MoveToNearestRailroadCard(boardHandler); }
public void Constructor() { var player = new Player("Name"); Assert.AreEqual("Name", player.ToString()); }
private IEnumerable<IPlayer> GeneratePlayerIEnumerable(Int32 numberOfPlayers) { var playerList = new List<IPlayer>(); while (numberOfPlayers-- > 0) { var player = new Player("Player " + numberOfPlayers); player.JailStrategy = new RandomlyPay(); player.OwnableStrategy = new RandomlyBuyOrMortgage(); playerList.Add(player); } return playerList; }