Example #1
0
        private TestResult Execute(TestMethod testMethod)
        {
            Timing.StopWatch timer = new Timing.StopWatch();
            int frames             = testMethod();

            timer.Pause();

            TestResult r = new TestResult();

            r.Name   = testMethod.Method.Name;
            r.Frames = frames;
            r.Time   = timer.TotalSeconds;

            return(r);
        }
Example #2
0
 private void btnCustomPause_Click(object sender, EventArgs e)
 {
     timer.Pause();
 }
Example #3
0
 public static void Show()
 {
     if (durations.Count + hintDurations.Count == 0 || messages.Count + hints.Count == 0)
     {
         return;
     }
     if (hintDurations.Count > 0)
     {
         if (stopwatch.TotalMilliseconds >= hintDurations[0])
         {
             hints.RemoveAt(0);
             hintDurations.RemoveAt(0);
             stopwatch.Reset();
             stopwatch.Pause();
         }
         if (durations.Count + hintDurations.Count == 0 || messages.Count + hints.Count == 0)
         {
             return;
         }
         stopwatch.Resume();
         if (hints.Count > 0)
         {
             font.DrawText(x, y, hints[0]);
         }
         if (hints.Count > 1)
         {
             font.DrawText(x, y + font.FontHeight, hints[1]);
             return;
         }
     }
     if (durations.Count > 0)
     {
         if (stopwatch.TotalMilliseconds >= durations[0])
         {
             messages.RemoveAt(0);
             durations.RemoveAt(0);
             stopwatch.Reset();
             stopwatch.Pause();
         }
         if (durations.Count + hintDurations.Count == 0 || messages.Count + hints.Count == 0)
         {
             return;
         }
         stopwatch.Resume();
         if (hints.Count >= 1)
         {
             if (messages.Count > 0)
             {
                 font.DrawText(x, y + font.FontHeight, messages[0]);
             }
         }
         else
         {
             if (messages.Count > 0)
             {
                 font.DrawText(x, y, messages[0]);
             }
             if (messages.Count > 1)
             {
                 font.DrawText(x, y + font.FontHeight, messages[1]);
             }
         }
     }
 }