Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }