コード例 #1
0
    public void TestAddArmor()
    {
        int expected = 300;
        //Arrange
        GameObject testObject = new GameObject();

        testObject.AddComponent <PowerUp>();
        testObject.AddComponent <playerController>();
        playerController playerc = testObject.GetComponent <playerController>();

        playerc.player = new GameObject();
        playerc.health = 100;
        PowerUp powerup = testObject.GetComponent <PowerUp>();

        powerup.player = playerc;
        powerup.AddArmor();
        Assert.AreEqual(expected, playerc.health, "Testing if we used the armor powerup.");
    }