Example #1
0
    public IEnumerator ThirdPersonUserControl_Skill_I_Test_WithEnumeratorPasses()
    {
        UnityEngine.SceneManagement.SceneManager.LoadScene("Untitled");
        SetCharacter.istest = true;
        yield return(null);

        /// init GameObject
        GameObject hero = SetCharacter.hero;

        Assert.AreNotEqual(hero, null);
        hero.transform.position = new Vector3(12, 0, 15);
        hero.transform.rotation = Quaternion.identity;

        GameObject enemy = SetCharacter.enemy;

        Assert.AreNotEqual(enemy, null);
        enemy.transform.position = new Vector3(14, 0, 15);
        enemy.transform.rotation = Quaternion.identity;

        hero.transform.LookAt(enemy.transform);
        /// init script test
        yield return(null);

        ThirdPersonUserControl testcs = hero.GetComponent <ThirdPersonUserControl> ();
        attribute message             = hero.GetComponent <attribute> ();

        message.HP_max = 100f;
        message.HP     = 20f;
        /// test Skill2
        message.Skill_Level [1] = 10;
        testcs.Operation_I();
        yield return(null); yield return(null);

        yield return(null); yield return(null);

        yield return(null); yield return(null);

        Assert.Greater(message.HP, 20f);

        SetCharacter.istest = false;
    }