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())); }
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(); } }
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); }