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