Example #1
0
 public void TestFinished(NUnit.Framework.Interfaces.ITestResult result)
 {
     if (!result.Test.IsSuite)
     {
         UnityEngine.Debug.Log("==============> TEST " + result.Test.FullName + ": " + result.ResultState.ToString().ToUpper());
         if (result.ResultState != NUnit.Framework.Interfaces.ResultState.Success)
         {
             UnityEngine.Debug.Log("Error Message: " + result.Message);
             UnityEngine.Debug.Log(result.StackTrace);
         }
         UnityEngine.Debug.Log("======================================================");
     }
 }
 public void TestFinished(NUnit.Framework.Interfaces.ITestResult result)
 {
     Debug.Log("Test finished");
 }
 public void TestFinished(NUnit.Framework.Interfaces.ITestResult result)
 {
     CallbacksDelegator.instance.TestFinished(result);
 }
Example #4
0
    static int SetTestStatus(NUnit.Framework.Interfaces.ITestResult test)
    {
        if (!test.Test.IsSuite)
        {
            var    status  = 0;
            string message = "";
            if (test.PassCount == 1)
            {
                status  = 1;
                message = "Passed in " + test.Duration;
                AltUnityTesterEditor.reportTestPassed++;
            }
            else if (test.FailCount == 1)
            {
                status  = -1;
                message = test.Message;
                AltUnityTesterEditor.reportTestFailed++;
            }

            AltUnityTesterEditor.timeTestRan += test.Duration;
            int index = AltUnityTesterEditor.EditorConfiguration.MyTests.FindIndex(a => a.TestName.Equals(test.Test.FullName));
            AltUnityTesterEditor.EditorConfiguration.MyTests[index].Status            = status;
            AltUnityTesterEditor.EditorConfiguration.MyTests[index].TestResultMessage = message;

            return(status);
        }

        var failCount        = 0;
        var notExecutedCount = 0;
        var passCount        = 0;

        foreach (var testChild in test.Children)
        {
            var status = SetTestStatus(testChild);
            if (status == 0)
            {
                notExecutedCount++;
            }
            else if (status == -1)
            {
                failCount++;
            }
            else
            {
                passCount++;
            }
        }

        if (test.Test.TestCaseCount != passCount + failCount + notExecutedCount)
        {
            AltUnityTesterEditor.EditorConfiguration.MyTests[AltUnityTesterEditor.EditorConfiguration.MyTests.FindIndex(a => a.TestName.Equals(test.Test.FullName))].Status = 0;
            return(0);
        }

        if (failCount > 0)
        {
            AltUnityTesterEditor.EditorConfiguration.MyTests[AltUnityTesterEditor.EditorConfiguration.MyTests.FindIndex(a => a.TestName.Equals(test.Test.FullName))].Status = -1;
            return(-1);
        }
        AltUnityTesterEditor.EditorConfiguration.MyTests[AltUnityTesterEditor.EditorConfiguration.MyTests.FindIndex(a => a.TestName.Equals(test.Test.FullName))].Status = 1;
        return(1);
    }
 public void RunFinished(NUnit.Framework.Interfaces.ITestResult testResults)
 {
     CallbacksDelegator.instance.RunFinished(testResults);
 }