Пример #1
0
    public IEnumerator ThirdPersonUserControl_Skill_O_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> ();
        float     predef = message.DEF_bouns;

        /// test Skill3
        message.Skill_Level [2] = 10;
        testcs.Operation_O();
        yield return(null); yield return(null);

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

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

        Assert.Greater(message.DEF_bouns, predef);

        SetCharacter.istest = false;
    }