Beispiel #1
0
        void nui.ITestListener.TestFinished(nui.ITestResult result)
        {
            var wrappedResult = new TestResultWrapper(result);

            OnTestFinished(new UnitTestResultEventArgs(wrappedResult));

            if (result.Test is nuint.TestAssembly)
            {
                _tcs.SetResult(new TestResultWrapper(_runner.Result));
            }
        }
Beispiel #2
0
        public void TestFinished(NUnit.Framework.Interfaces.ITestResult result)
        {
            JSONClass jsonClass = new JSONClass();

            jsonClass.Add("name", result.Name);
            jsonClass.Add("uuid", myUUID);
            string typeText;

            if (result.ResultState == ResultState.Ignored)
            {
                typeText = "TestIgnored";
            }
            else if (result.ResultState == ResultState.Success)
            {
                typeText = "TestFinished";
            }
            else
            {
                typeText = "TestFailed";
            }

            jsonClass.Add("type", typeText);
            string message = result.Message;

            if (message != null)
            {
                jsonClass.Add("message", message);
            }
            string trace = result.StackTrace;

            if (trace != null)
            {
                jsonClass.Add("stackTrace", trace);
            }
            jsonClass.Add("time", result.Duration.ToString());

            ConsuloIntegration.SendToConsulo("unityTestState", jsonClass);
        }
 public TestResultWrapper(nui.ITestResult result)
 {
     _result = result;
 }