public IAssertionResult WarningInTheScene()
    {
        IAssertionResult result = null;

        if (this.WarningTextObject == null)
        {
            result = new AssertionResultRetry("No warning on the scene");
        }
        else if (!this.WarningTextObject.activeSelf)
        {
            result = new AssertionResultRetry("No visible warning on the scene");
        }
        else
        {
            Text text = this.WarningTextObject.GetComponent <Text>();
            if (text.text.Equals(this.ExpectedWarningText))
            {
                result = new AssertionResultSuccessful();
            }
            else
            {
                result = new AssertionResultFailed("The warning message has not the expected text: \"" + text.text + "\" instead of \"" + this.ExpectedWarningText);
            }
        }

        return(result);
    }
Example #2
0
    public IAssertionResult PressTheButtonCreate()
    {
        IAssertionResult result       = new AssertionResultSuccessful();
        GameObject       buttonCreate = GameObject.FindWithTag(ButtonCreateTag);
        Button           button       = buttonCreate.GetComponent <Button>();

        button.onClick.Invoke();
        return(result);
    }
Example #3
0
    public IAssertionResult TheNewObjectAppears()
    {
        IAssertionResult result = null;
        GameObject       cube   = GameObject.FindWithTag(CubeTag);

        if (cube == null || !cube.name.Equals(CubeName))
        {
            result = new AssertionResultRetry("\"" + CubeName + "\" not found");
        }
        else if (cube != null && cube.activeSelf)
        {
            result = new AssertionResultSuccessful();
        }

        return(result);
    }
    public IAssertionResult OnlyACubeInTheScene()
    {
        IAssertionResult result = null;

        GameObject[] cubes = GameObject.FindGameObjectsWithTag(CubeTag);
        if (this.listOfCubesInTheScene.SequenceEqual(cubes) == false)
        {
            result = new AssertionResultFailed("The objects in the scene are changed!");
        }
        else
        {
            result = new AssertionResultSuccessful();
        }

        return(result);
    }
Example #5
0
    public IAssertionResult TheCubeDisappears()
    {
        IAssertionResult result = null;
        GameObject       cube   = GameObject.FindWithTag(CubeTag);

        if (cube != null && cube.activeSelf)
        {
            result = new AssertionResultRetry("\"object for test\" found and Active");
        }
        else if (cube != null)
        {
            result = new AssertionResultRetry("\"object for test\" found inactive");
        }
        else
        {
            result = new AssertionResultSuccessful();
        }

        return(result);
    }
Example #6
0
    public IAssertionResult StartedAndWaitingForInput()
    {
        IAssertionResult result       = null;
        GameObject       cube         = GameObject.FindWithTag(CubeTag);
        GameObject       buttonCreate = GameObject.FindWithTag(ButtonCreateTag);

        if (buttonCreate == null)
        {
            result = new AssertionResultRetry("Button Create not found");
        }
        else if (cube != null)
        {
            result = new AssertionResultFailed("There is an unexpected cube in the scene.");
        }
        else if (buttonCreate != null && buttonCreate.activeSelf)
        {
            result = new AssertionResultSuccessful();
        }

        return(result);
    }
Example #7
0
    public IAssertionResult ThenMethod()
    {
        IAssertionResult result = new AssertionResultSuccessful();

        return(result);
    }