public TestScenario() { UniqueId = Guid.NewGuid(); TestResults = new List <ITestResult>(); TestCases = new List <ITestCase>(); Statistics = new TestStat(); enStatus = TestStatuses.NotRun; }
// 20141102 // try{ // if (TestData.CurrentTestResult.Details.Count > 0) { // // TestData.AddTestResult( // "autoclosed", // TestData.GetTestResultId(), // null, // false, // isKnownIssue // false, // generateNextResult // null, // MyInvocation // null, // Error // string.Empty, // TestResultOrigins.Automatic, // false); // } else { // TestData.CurrentTestResult = null; // } // } // catch {} // // this.SetNow(); // // // in detail 20140713 // var testSuite1 = TestData.TestSuites[TestData.TestSuites.Count - 1]; // var testScenario1 = testSuite1.TestScenarios[testSuite1.TestScenarios.Count - 1]; // HERE!! // string testScenarioId1 = testScenario1.Id; // // string testScenarioId1 = TestData.TestSuites[TestData.TestSuites.Count - 1].TestScenarios[TestData.TestSuites[TestData.TestSuites.Count - 1].TestScenarios.Count - 1].Id; // string testSuiteId1 = TestData.TestSuites[TestData.TestSuites.Count - 1].Id; // // 20140723 // // var testResult1 = new TestResult(testScenarioId1, testSuiteId1); // // this.TestResults.Add(testResult1); // this.TestResults.Add(new TestResult(testScenarioId1, testSuiteId1)); // ?? //// this.TestResults.Add( //// new TestResult( //// TestData.TestSuites[TestData.TestSuites.Count - 1].TestScenarios[TestData.TestSuites[TestData.TestSuites.Count - 1].TestScenarios.Count - 1].Id, // "???", //// TestData.TestSuites[TestData.TestSuites.Count - 1].Id)); // "???")); // TestData.CurrentTestResult = this.TestResults[TestResults.Count - 1]; // } public TestScenario( string testScenarioName, string testScenarioId, string testSuiteId) { UniqueId = Guid.NewGuid(); TestResults = new List <ITestResult>(); TestCases = new List <ITestCase>(); Statistics = new TestStat(); enStatus = TestStatuses.NotRun; Name = testScenarioName; Id = !string.IsNullOrEmpty(testScenarioId) ? testScenarioId : TestData.GetTestScenarioId(); SuiteId = testSuiteId; try{ if (TestData.CurrentTestResult.Details.Count > 0) { TestData.AddTestResult( "autoclosed", TestData.GetTestResultId(), null, false, // isKnownIssue false, // generateNextResult // 20160116 // null, // MyInvocation null, // Error string.Empty, TestResultOrigins.Automatic, false); } else { TestData.CurrentTestResult = null; } } catch {} SetNow(); TestResults.Add( new TestResult( Id, SuiteId)); try { if ((null != TestData.CurrentTestResult.Name || null != TestData.CurrentTestResult.Id) && null != TestData.CurrentTestResult.Details && 0 < TestData.CurrentTestResult.Details.Count) { TestData.CurrentTestScenario.TestResults.Add(TestData.CurrentTestResult); } } catch (Exception) { //Console.WriteLine(eeeee.Message); } TestData.CurrentTestResult = TestResults[TestResults.Count - 1]; }
public TestSuite() { UniqueId = Guid.NewGuid(); TestScenarios = new List <ITestScenario>(); Statistics = new TestStat(); enStatus = TestStatuses.NotRun; Id = TestData.GetTestSuiteId(); addDefaultPlatform(); SetNow(); }
public TestSuite(string testSuiteName, string testSuiteId) { UniqueId = Guid.NewGuid(); TestScenarios = new List <ITestScenario> (); Statistics = new TestStat(); enStatus = TestStatuses.NotRun; Name = testSuiteName; Id = testSuiteId != string.Empty ? testSuiteId : TestData.GetTestSuiteId(); addDefaultPlatform(); SetNow(); }