Example #1
0
        public void TestCheckDoNotSellIfNoResources()
        {
            GameObject temp = new GameObject();

            ResourceManager rs = temp.AddComponent <ResourceManager>();

            rs.SetMetal(0, PlayerTypes.humanPlayer);
            rs.SetWood(0, PlayerTypes.humanPlayer);
            rs.SetStone(0, PlayerTypes.humanPlayer);

            MarketUI market = temp.AddComponent <MarketUI>();

            market.woodButtonPressed();
            market.sellResource();
            market.stoneButtonPressed();
            market.sellResource();
            market.metalButtonPressed();
            market.sellResource();

            int actual = rs.GetMetal(PlayerTypes.humanPlayer);

            Assert.AreEqual(0, actual);
            actual = rs.GetWood(PlayerTypes.humanPlayer);
            Assert.AreEqual(0, actual);
            actual = rs.GetStone(PlayerTypes.humanPlayer);
            Assert.AreEqual(0, actual);
        }
Example #2
0
        public void TestButtonPressedForSellWood()
        {
            GameObject temp = new GameObject();

            ResourceManager rs = temp.AddComponent <ResourceManager>();

            rs.SetWood(20, PlayerTypes.humanPlayer);
            MarketUI market = temp.AddComponent <MarketUI>();

            market.woodButtonPressed();
            market.sellResource();
            int actual = rs.GetWood(PlayerTypes.humanPlayer);

            Assert.AreEqual(10, actual);
        }