Esempio n. 1
0
        private static void TestInitialization(ITestResultsProvider provider)
        {
            DateTime testBegin = DateTime.Now;

            provider.Initialize();
            TimeSpan passedTime = DateTime.Now - testBegin;

            Console.Out.WriteLine(string.Format("Initialization {1} spent time: {0}", passedTime.TotalMilliseconds, provider.GetName()));
        }
Esempio n. 2
0
 public TestExecutor(Test test, ITestResultsProvider resultsProvider, int executionNumber,
                     bool tracking, bool contextCaching, bool deferredInitialization)
 {
     this.test            = test;
     this.resultsProvider = resultsProvider;
     this.executionNumber = executionNumber;
     this.contextCaching  = contextCaching;
     this.tracking        = tracking;
     if (!deferredInitialization)
     {
         resultsProvider.Initialize();
     }
 }
Esempio n. 3
0
        public PerformanceResults Initialize()
        {
            PerformanceResults perfResults = new PerformanceResults()
            {
                Test = test
            };

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            resultsProvider.Initialize();

            stopwatch.Stop();
            perfResults.AvgTimeCost = perfResults.TotalTimeCost = (double)stopwatch.ElapsedMilliseconds / executionNumber;

            return(perfResults);
        }