示例#1
0
    public void OutScoM()
    {
        // Use the Assert class to test conditions.
        BreakingEffect BE = new BreakingEffect();

        // If user input Mu with out of scope value. Get the exception invalid mu.
        Assert.Catch <System.Exception>(() => BE.InputVerify(5, (float)99, GameObject.Find("TargetObj")));
    }
示例#2
0
    public void NonNumMu()
    {
        // Use the Assert class to test conditions.
        BreakingEffect BE = new BreakingEffect();

        // If user input mu as non-number value, Unity will consider it as 0 by default. Get the same exception invalid mu.
        Assert.Catch <System.Exception>(() => BE.InputVerify(5, (float)0, GameObject.Find("TargetObj")));
    }
示例#3
0
    public void NoObj()
    {
        // Use the Assert class to test conditions.
        BreakingEffect BE = new BreakingEffect();

        //Input a "null" target object
        Assert.Catch <System.NullReferenceException>(() => BE.InputVerify(5, (float)0.2, GameObject.Find("Null")));
    }
示例#4
0
    public void NoExpLv()
    {
        // Use the Assert class to test conditions.
        BreakingEffect BE = new BreakingEffect();

        // If user does not input E, Unity will consider it as 0 by default. Get the same exception invalid E.
        Assert.Catch <System.Exception>(() => BE.InputVerify(0, (float)0.2, GameObject.Find("TargetObj")));
    }
示例#5
0
    public void OutScoC()
    {
        // Use the Assert class to test conditions.
        BreakingEffect BE = new BreakingEffect();
        // Create a target object that has invalid coordinates.
        GameObject GO = new GameObject();

        GO.transform.position = new Vector3(0, 99999, 0);
        Assert.Catch <System.Exception>(() => BE.InputVerify(5, (float)0.2, GO));
    }