Пример #1
0
        protected override void OnTestFinished(UnitTestResultEventArgs e)
        {
            base.OnTestFinished(e);
            var result = e.Result;

            if (!result.Test.IsSuite)
            {
                _progressArgs.AddResult(result);
                OnProgress(_progressArgs);
            }
        }
Пример #2
0
        protected override void OnTestFinished(UnitTestResultEventArgs e)
        {
            base.OnTestFinished(e);
            var result = e.Result;

            if (!result.Test.IsSuite)
            {
                lock (lastTestLock)
                {
                    if (ShowOutput && !string.IsNullOrEmpty(result.Output))
                    {
                        WriteTest(result.Test);
                        WriteLog(result.Output);
                    }

                    if (result.Status != TestStatus.Passed && result.Status != TestStatus.Skipped)
                    {
                        WriteTest(result.Test);
                        var assertions = result.Assersions;
                        if (assertions != null)
                        {
                            foreach (var assertion in assertions)
                            {
                                if (assertion.Status == TestStatus.Passed)
                                {
                                    continue;
                                }
                                if (!string.IsNullOrEmpty(assertion.StackTrace))
                                {
                                    WriteLog($"{assertion.Status}: {assertion.Message}\n{assertion.StackTrace}");
                                }
                                else
                                {
                                    WriteLog($"{assertion.Status}: {assertion.Message}");
                                }
                            }
                        }
                        else
                        {
                            WriteLog($"{result.Status}: {result.Message}");
                        }
                    }
                }
            }
        }
Пример #3
0
 protected virtual void OnTestFinished(UnitTestResultEventArgs e) => TestFinished?.Invoke(this, e);
Пример #4
0
 private void _inner_TestFinished(object sender, UnitTestResultEventArgs e) => OnTestFinished(e);
Пример #5
0
 private void currentRunner_TestFinished(object sender, UnitTestResultEventArgs e)
 {
     OnTestFinished(e);
 }