/// <summary> /// Creates test run. /// </summary> private void CreateTestRun() { // Skip run creation if already exists. if (testRun != null) { return; } Guid runId = Guid.NewGuid(); this.testRun = new TestRun(runId); // We cannot rely on the StartTime for the first test result // In case of parallel, first test result is the fastest test and not the one which started first. // Setting Started to DateTime.Now in Intialize will make sure we include the startup cost, which was being ignored earlier. // This is in parity with the way we set this.testRun.Finished this.testRun.Started = this.testRunStartTime; // Save default test settings string runDeploymentRoot = FileHelper.ReplaceInvalidFileNameChars(this.testRun.Name); TestRunConfiguration testrunConfig = new TestRunConfiguration("default"); testrunConfig.RunDeploymentRootDirectory = runDeploymentRoot; this.testRun.RunConfiguration = testrunConfig; }
// Initializes trx logger cache. private void InitializeInternal() { this.results = new ConcurrentDictionary <Guid, TrxLoggerObjectModel.ITestResult>(); this.innerResults = new ConcurrentDictionary <Guid, TrxLoggerObjectModel.ITestResult>(); this.testElements = new ConcurrentDictionary <Guid, ITestElement>(); this.entries = new ConcurrentDictionary <Guid, TestEntry>(); this.innerTestEntries = new ConcurrentDictionary <Guid, TestEntry>(); this.runLevelErrorsAndWarnings = new List <RunInfo>(); this.testRun = null; this.totalTests = 0; this.passTests = 0; this.failTests = 0; this.runLevelStdOut = new StringBuilder(); this.testRunStartTime = DateTime.UtcNow; }
/// <summary> /// Sets the test run the test was executed in /// </summary> /// <param name="testRun">The test run the test was executed in</param> internal virtual void SetTestRun(TestRun testRun) { Debug.Assert(testRun != null, "'testRun' is null"); this.testRun = testRun; }