コード例 #1
0
        //public static void ExecuteStep( Action stepMethod, Func<bool> goNogoMethod )
        //{
        //    if ( goNogoMethod() )
        //    {
        //        var runStorer = new DbfRunStorer();
        //        ExecuteStep( stepMethod, runStorer );
        //    }
        //    else
        //        Announce( string.Format( "{0} skipped.", stepMethod.Method.Name ), 0 );
        //}

        public static void ExecuteStep(Action stepMethod, IRunStorer runStorer)
        {
            Announce(string.Format("---- {0} --------------------------------", stepMethod.Method.Name), 0);
            var stopwatch = new Stopwatch();

            stopwatch.Start();
            Announce(string.Format("{0} ...", stepMethod.Method.Name), 0);
            stepMethod.Invoke();
            var ts = StopTheWatch(stopwatch, string.Format("Finished: {0}", stepMethod.Method.Name));

            Announce("============================================", 0);
            if (runStorer != null)
            {
                runStorer.StoreRun(stepMethod.Method.Name, ts);
            }
        }
コード例 #2
0
ファイル: Utility.cs プロジェクト: Quarterback16/GerardGui
 //public static void ExecuteStep( Action stepMethod, Func<bool> goNogoMethod )
 //{
 //    if ( goNogoMethod() )
 //    {
 //        var runStorer = new DbfRunStorer();
 //        ExecuteStep( stepMethod, runStorer );
 //    }
 //    else
 //        Announce( string.Format( "{0} skipped.", stepMethod.Method.Name ), 0 );
 //}
 public static void ExecuteStep(Action stepMethod, IRunStorer runStorer)
 {
     Announce(string.Format("---- {0} --------------------------------", stepMethod.Method.Name), 0);
      var stopwatch = new Stopwatch();
      stopwatch.Start();
      Announce(string.Format("{0} ...", stepMethod.Method.Name), 0);
      stepMethod.Invoke();
      var ts = StopTheWatch(stopwatch, string.Format("Finished: {0}", stepMethod.Method.Name));
      Announce("============================================", 0);
      if (runStorer != null)
     runStorer.StoreRun(stepMethod.Method.Name, ts);
 }