/// <summary>
 /// Update the case status and case log
 /// Find the related case name, change its status and show log to user
 /// </summary>
 public void UpdateCaseFromHtmlLog(TestCaseStatus status, string testCaseName, string testCaseLogPath)
 {
     runningTestCase = AllTestCases.FirstOrDefault(c => c.Name == testCaseName);
     if (runningTestCase == null)
     {
         return;
     }
     GroupByOutcome.ChangeStatus(testCaseName, status);
     runningTestCase.LogUri = new Uri(testCaseLogPath);
     runningTestCase        = null;
 }
Exemple #2
0
 /// <summary>
 /// Update the case status and case log
 /// Find the related case name, change its status and show log to user
 /// </summary>
 public void UpdateCaseFromHtmlLog(TestCaseStatus status, string testCaseName, TestCaseDetail detail, string testCaseLogPath)
 {
     RunningTestCase = AllTestCases.FirstOrDefault(c => c.Name == testCaseName);
     if (RunningTestCase == null)
     {
         return;
     }
     GroupByOutcome.ChangeStatus(testCaseName, status);
     RunningTestCase.LogUri          = new Uri(testCaseLogPath);
     RunningTestCase.Assembly        = detail.Source;
     RunningTestCase.StartTime       = detail.StartTime;
     RunningTestCase.EndTime         = detail.EndTime;
     RunningTestCase.StdOut          = String.Join("\n", detail.StandardOut.Select(output => output.Content));
     RunningTestCase.ErrorMessage    = String.Join("\n", detail.ErrorMessage);
     RunningTestCase.ErrorStackTrace = String.Join("\n", detail.ErrorStackTrace);
     RunningTestCase = null;
 }
Exemple #3
0
        public void GetTestCaseDetails(string testCaseId)
        {
            ITestCase testCase = AllTestCases.SingleOrDefault(t => t.Id.Equals(Int32.Parse(testCaseId)));

            if (testCase != null)
            {
                Console.WriteLine("Test Case title \"{0}\" with Id:{1} has below field details:", testCase.Title,
                                  testCase.Id);
                Console.WriteLine("Field Name:Field Value");
                for (int i = 0; i < testCase.CustomFields.Count; i++)
                {
                    Console.WriteLine("{0}:{1}", testCase.CustomFields[i].Name, testCase.CustomFields[i].Value);
                }
            }
            else
            {
                Console.WriteLine("Test Case with Id:{0} not found.", testCaseId);
            }
        }
        public IEnumerable <TestCase> CheckTestCasesExplicit(IEnumerable <TestCase> filteredTestCases)
        {
            var explicitCases = new List <TestCase>();

            foreach (var tc in filteredTestCases)
            {
                var correspondingNUnitTestCase = AllTestCases.FirstOrDefault(o => o.FullName == tc.FullyQualifiedName);
                if (correspondingNUnitTestCase == null)
                {
                    TestLog.Warning(
                        $"CheckExplicit: Can't locate corresponding NUnit testcase {tc.FullyQualifiedName}");
                    continue;
                }

                if (correspondingNUnitTestCase.IsExplicitReverse)
                {
                    explicitCases.Add(tc);
                }
            }
            return(explicitCases);
        }
Exemple #5
0
 public ITestCase GeTestCaseByTitle(string title)
 {
     return
         (AllTestCases
          .FirstOrDefault(t => t.Title.Equals(title, StringComparison.InvariantCultureIgnoreCase)));
 }