Ejemplo n.º 1
0
        public void TestPurchase()
        {
            TradableProperty tradableProperty = new TradableProperty();
            Player           player           = new Player("Tom");

            tradableProperty.purchase(ref player);
            Assert.AreEqual(player.getBalance(), 1300);
            Assert.AreEqual(tradableProperty.getOwner().getName(), "Tom");
            Player player2 = new Player("Jerry");

            try
            {
                tradableProperty.purchase(ref player2);
            }catch (ApplicationException e)
            {
                Assert.AreEqual("System.ApplicationException", e.ToString().Substring(0, 27));
            }
        }