Пример #1
0
        private static void OnTestFinished(object sender, TestEventArgs e)
        {
            if (e.Status == TestRunStatus.Success && (e.Test.Suite.ExecutedTestCount % 20) != 0)
            {
                return;
            }
            lock (lockObject)
            {
                if (e.Status == TestRunStatus.Failed)
                {
                    if (newlineRequired)
                    {
                        Console.WriteLine();
                    }
                    var mode = e.StrictMode ? " (strict)" : "";
                    Console.WriteLine("{0}{1}: {2}", e.Test.Name, mode, e.FailureException.Message);
                    newlineRequired = false;
                    //Console.WriteLine(e.Test.Script);
                }

                if (e.Status != TestRunStatus.Skipped)
                {
                    executedTests++;
                    if ((executedTests % 20) == 0)
                    {
                        if ((executedTests % 100) == 0)
                        {
                            if (newlineRequired)
                            {
                                Console.WriteLine();
                            }
                            Console.WriteLine("Executed {0} tests", e.Test.Suite.ExecutedTestCount);
                            newlineRequired = false;
                        }
                        else
                        {
                            Console.Write(".");
                            newlineRequired = true;
                        }
                    }
                }
            }
        }
Пример #2
0
 private void OnTestFinished(object sender, TestEventArgs e)
 {
     if (e.Status == TestRunStatus.Failed)
     {
         this.FailuresStackPanel.Dispatcher.BeginInvoke(() =>
         {
             this.FailuresStackPanel.Children.Add(new TextBlock() { Text = "Failed: " + e.Test.Name });
         });
     }
     if (DateTime.Now.Subtract(lastUpdate).TotalSeconds >= 0.1)
     {
         this.StatusTextBlock.Dispatcher.BeginInvoke(() =>
         {
             this.StatusTextBlock.Text = string.Format("{0} / {1} ({2:p})",
                 this.suite.ExecutedTestCount, this.suite.ApproximateTotalTestCount, (double)this.suite.ExecutedTestCount / this.suite.ApproximateTotalTestCount);
         });
         lastUpdate = DateTime.Now;
     }
 }
Пример #3
0
        private static void OnTestFinished(object sender, TestEventArgs e)
        {
            if (e.Status == TestRunStatus.Success && (e.Test.Suite.ExecutedTestCount % 20) != 0)
                return;
            lock (lockObject)
            {
                if (e.Status == TestRunStatus.Failed)
                {
                    if (newlineRequired)
                        Console.WriteLine();
                    var mode = e.StrictMode ? " (strict)" : "";
                    Console.WriteLine("{0}{1}: {2}", e.Test.Name, mode, e.FailureException.Message);
                    newlineRequired = false;
                    //Console.WriteLine(e.Test.Script);
                }

                if (e.Status != TestRunStatus.Skipped)
                {
                    executedTests++;
                    if ((executedTests % 20) == 0)
                    {
                        if ((executedTests % 100) == 0)
                        {
                            if (newlineRequired)
                                Console.WriteLine();
                            Console.WriteLine("Executed {0} tests", e.Test.Suite.ExecutedTestCount);
                            newlineRequired = false;
                        }
                        else
                        {
                            Console.Write(".");
                            newlineRequired = true;
                        }
                    }
                }
            }
        }