Exemplo n.º 1
0
    public void TestRedSpaceLand()
    {
        GameObject      player1 = PlayerInventoryTest.CreatePlayerGameObject();
        GameObject      player2 = PlayerInventoryTest.CreatePlayerGameObject();
        PlayerInventory pi1     = player1.GetComponent <PlayerInventory>();
        PlayerInventory pi2     = player2.GetComponent <PlayerInventory>();

        pi1.AddCoins(10);
        pi2.AddCoins(2);

        GameObject    redSpace          = CreateRedSpace();
        AbstractSpace redSpaceComponent = redSpace.GetComponent <AbstractSpace>();

        redSpaceComponent.StartCoroutine(redSpaceComponent.OnPlayerLand(player1));
        redSpaceComponent.StartCoroutine(redSpaceComponent.OnPlayerLand(player2));

        Assert.AreEqual(7, pi1.Coins);
        Assert.AreEqual(0, pi2.Coins);
    }
Exemplo n.º 2
0
    public void TestBlueSpaceLand()
    {
        GameObject player    = PlayerInventoryTest.CreatePlayerGameObject();
        GameObject blueSpace = CreateBlueSpace();

        AbstractSpace blueSpaceComponent = blueSpace.GetComponent <AbstractSpace>();

        blueSpaceComponent.StartCoroutine(blueSpaceComponent.OnPlayerLand(player));
        Assert.AreEqual(3, player.GetComponent <PlayerInventory>().Coins);
    }