Esempio n. 1
0
        private void TestResultHandler(SA_TestResult result)
        {
            var color = result.IsFailed ? "red" : "green";

            m_text.text += string.Format("<color=\"{0}\">{1}</color>\n", color, result.Message);
            Debug.Log(result.Message);
        }
Esempio n. 2
0
 private void TestFinishedHandler(SA_TestResult obj)
 {
     OnTestFinished.Invoke(obj);
     if (obj.IsFailed && m_currentTest.TestStopsTestGroup)
     {
         m_currentTest = null;
         m_callback.Invoke();
     }
     else
     {
         m_currentTest = null;
         RunNextTest();
     }
 }
 public void Execute()
 {
     m_test = (SA_BaseTest)Activator.CreateInstance(m_testConfig.TestReference.Type);
     OnTestStart.Invoke();
     OnTestStart      = delegate { };
     m_test.OnResult += TestResultHandler;
     if (!m_test.RequireUserInteraction)
     {
         // m_timeoutCoroutine = SA_Coroutine.WaitForSeconds(TIMEOUT, OnTimeOut);
         SA_Coroutine.WaitForSeconds(TIMEOUT, OnTimeOut);
     }
     try {
         m_test.Test();
     }
     catch (Exception e) {
         ClearListener();
         FireResult(SA_TestResult.WithError("Failed with Exception " + e.GetBaseException().Message));
     }
 }
 public override void Test()
 {
     SetResult(SA_TestResult.FromSAResult(new SA.Foundation.Templates.SA_Result(new SA.Foundation.Templates.SA_Error(100, "error message"))));
 }
 private void TestResultHandler(SA_BaseTest target, SA_TestResult obj)
 {
     ClearListener();
     FireResult(obj);
 }
 private void FireResult(SA_TestResult obj)
 {
     OnTestFinished.Invoke(obj);
     OnTestFinished = delegate { };
 }
Esempio n. 7
0
 protected void SetAPIResult(SA_Result result)
 {
     SetResult(SA_TestResult.FromSAResult(result));
 }
Esempio n. 8
0
 protected void SetResult(SA_TestResult result)
 {
     m_result = result;
     OnResult.Invoke(this, m_result);
 }