Exemple #1
0
        public static CaseResult MapToCaseResult(this TestResultEventArgs args)
        {
            var caseResult = new CaseResult
            {
                CaseId  = GetTestCaseId(args),
                Title   = GetTitle(args),
                Status  = GetResult(args),
                Comment = GetComment(args)
            };

            return(caseResult);
        }
Exemple #2
0
 public void AddToCollection(ulong testRailCaseId, CaseResult caseResult)
 {
     if (_results.TryGetValue(testRailCaseId, out var list))
     {
         list.Add(caseResult);
     }
     else
     {
         list = new ConcurrentBag <CaseResult>();
         list.Add(caseResult);
         _results.TryAdd(testRailCaseId, list);
     }
 }
Exemple #3
0
        public void AddResultToCollection(ulong?runId, CaseResult caseResult)
        {
            if (runId == null)
            {
                return;
            }
            if (caseResult.CaseId == null && !string.IsNullOrEmpty(caseResult.Title))
            {
                var run   = _client.GetRun(runId.Value);
                var cases = _client.GetCases(run.ProjectID.Value, run.SuiteID.Value);
                var @case = cases.FirstOrDefault(i => i.Title == caseResult.Title);
                caseResult.CaseId = @case?.ID;
            }

            if (caseResult.CaseId == null)
            {
                return;
            }
            // Do not override Failed test result with Passed status
            AddToCollection(caseResult.CaseId.Value, caseResult);
        }