Exemple #1
0
 public void checkImageName()
 {
     StaticSceneManager.setImage("cenoura_carrot");
     StaticLanguage.setLanguage("portuguese");
     game.Start();
     Assert.That("CENOURA" == game.solution);
 }
Exemple #2
0
    public void checkError()
    {
        StaticSceneManager.setImage("cenoura_carrot");
        StaticLanguage.setLanguage("portuguese");
        game.Start();
        GameObject go     = new GameObject();
        Button     button = go.AddComponent <Button> ();

        for (int i = 0; i < 15; i++)
        {
            if ((ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text != "C") &&
                (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text != "E") &&
                (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text != "N") &&
                (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text != "O") &&
                (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text != "U") &&
                (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text != "R") &&
                (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text != "A"))
            {
                button = ButtonList [i];
            }
        }

        game.taskOnClick(button, game.solution);
        game.Update();
        game.taskOnClick(button, game.solution);
        game.Update();
        game.taskOnClick(button, game.solution);
        game.Update();

        Assert.That(game.wrong.activeSelf == true);
    }
Exemple #3
0
 void taskOnClick(string language)
 {
     StaticLanguage.setLanguage(language);
     gameWorld.GetComponent <Image>().sprite = Resources.Load("Menu/" + language + "/gameworld", typeof(Sprite)) as Sprite;
     settings.GetComponent <Image>().sprite  = Resources.Load("Menu/" + language + "/settings", typeof(Sprite)) as Sprite;
     avatar.GetComponent <Image>().sprite    = Resources.Load("Menu/" + language + "/avatar", typeof(Sprite)) as Sprite;
 }
Exemple #4
0
    public void checkLetterInsertionBegginingOfWord()
    {
        StaticSceneManager.setImage("cenoura_carrot");
        StaticLanguage.setLanguage("portuguese");
        game.Start();
        GameObject go     = new GameObject();
        Button     button = go.AddComponent <Button> ();

        for (int i = 0; i < 15; i++)
        {
            if (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text == "C")
            {
                button = ButtonList [i];
            }
        }

        game.taskOnClick(button, game.solution);

        Assert.That(game.text.text [1].ToString() == "C");
    }
Exemple #5
0
    public void checkWin()
    {
        StaticSceneManager.setImage("cenoura_carrot");
        StaticLanguage.setLanguage("portuguese");
        game.Start();
        GameObject go      = new GameObject();
        Button     button  = go.AddComponent <Button> ();
        Button     button1 = Instantiate(button);
        Button     button2 = Instantiate(button);
        Button     button3 = Instantiate(button);
        Button     button4 = Instantiate(button);
        Button     button5 = Instantiate(button);
        Button     button6 = Instantiate(button);
        Button     button7 = Instantiate(button);

        for (int i = 0; i < 15; i++)
        {
            if (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text == "C")
            {
                button1 = ButtonList [i];
            }
        }
        for (int i = 0; i < 15; i++)
        {
            if (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text == "E")
            {
                button2 = ButtonList [i];
            }
        }
        for (int i = 0; i < 15; i++)
        {
            if (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text == "N")
            {
                button3 = ButtonList [i];
            }
        }
        for (int i = 0; i < 15; i++)
        {
            if (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text == "O")
            {
                button4 = ButtonList [i];
            }
        }
        for (int i = 0; i < 15; i++)
        {
            if (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text == "U")
            {
                button5 = ButtonList [i];
            }
        }
        for (int i = 0; i < 15; i++)
        {
            if (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text == "R")
            {
                button6 = ButtonList [i];
            }
        }
        for (int i = 0; i < 15; i++)
        {
            if (ButtonList [i].GetComponent <UnityEngine.UI.Text> ().text == "A")
            {
                button7 = ButtonList [i];
            }
        }

        game.taskOnClick(button1, game.solution);
        game.taskOnClick(button2, game.solution);
        game.taskOnClick(button3, game.solution);
        game.taskOnClick(button4, game.solution);
        game.taskOnClick(button5, game.solution);
        game.taskOnClick(button6, game.solution);
        game.taskOnClick(button7, game.solution);

        game.Update();

        Assert.That(game.check.activeSelf == true);
    }