public void TestBuyAndRentSupplierField() { Game game = new Game(new Player[] { new Player("XXX"), new Player("YYY") }); SupplierField field7 = (SupplierField)game.Fields[7]; SupplierField field8 = (SupplierField)game.Fields[8]; field7.OnEnter(game.Players[1]); Assert.That(game.Players[1].Money, Is.EqualTo(1500)); field7.Buy(game.Players[0]); game.SetLastThrow(game.Players[1], new List <int[]> { new int[] { 6, 6 }, }); field7.OnEnter(game.Players[1]); Assert.That(game.Players[1].Money, Is.EqualTo(1500 - (48))); field8.Buy(game.Players[0]); game.SetLastThrow(game.Players[1], new List <int[]> { new int[] { 6, 6 }, }); field7.OnEnter(game.Players[1]); Assert.That(game.Players[1].Money, Is.EqualTo(1500 - (120) - 48)); }
public void TestExChangeSupplierFieldwithField() { Game game = new Game(new Player[] { new Player("XXX"), new Player("YYY") }); StreetField field1 = ((StreetField)game.Fields[1]); SupplierField field7 = ((SupplierField)game.Fields[7]); field1.Buy(game.Players[0]); field7.Buy(game.Players[1]); field7.ExchangeField(field7.Owner, game.Players[0], field1); Assert.That(field1.Owner.Name, Is.EqualTo(game.Players[1].Name)); Assert.That(field7.Owner.Name, Is.EqualTo(game.Players[0].Name)); }
public void TestexChangeSupplierFieldMoney() { Game game = new Game(new Player[] { new Player("XXX"), new Player("YYY") }); SupplierField field7 = ((SupplierField)game.Fields[7]); field7.Buy(game.Players[0]); field7.ExchangeField(game.Players[0], game.Players[1], 60); Assert.That(game.Players[0].OwnerShip.Count(), Is.EqualTo(0)); Assert.That(game.Players[0].Money, Is.EqualTo(1500 - 150 + 60)); Assert.That(game.Players[1].OwnerShip[0].Name, Is.EqualTo(FieldNames.WaterWorks)); Assert.That(game.Players[1].Money, Is.EqualTo(1440)); Assert.That(field7.Owner.Name, Is.EqualTo(game.Players[1].Name)); }
public void TestPayOffMortageSupplierField() { Game game = new Game(new Player[] { new Player("XXX"), new Player("YYY") }); SupplierField field7 = (SupplierField)game.Fields[7]; SupplierField field8 = (SupplierField)game.Fields[8]; field7.Buy(game.Players[0]); field7.TakeMortage(game.Players[0]); Assert.That(field7.IsMortage, Is.EqualTo(true)); field7.PayOffMortage(game.Players[0]); Assert.That(field7.IsMortage, Is.EqualTo(false)); Assert.That(game.Players[0].Money, Is.EqualTo(1500 - 150 + 75 - 82)); Assert.That(() => field7.PayOffMortage(game.Players[1]), Throws.InvalidOperationException); field8.Buy(game.Players[0]); Assert.That(() => field8.PayOffMortage(game.Players[0]), Throws.InvalidOperationException); }