Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed May 30, 2023
1 parent 736ce11 commit d52c8e9
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions GitHubActionsTestLogger/Utils/Extensions/TestResultExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ internal static class TestResultExtensions

public static string? TryGetSourceFilePath(this TestResult testResult)
{
// See if the test runner provided it (never actually happens)
// See if it was provided directly (requires source information collection to be enabled)
if (!string.IsNullOrWhiteSpace(testResult.TestCase.CodeFilePath))
return testResult.TestCase.CodeFilePath;

Expand All @@ -57,20 +57,11 @@ internal static class TestResultExtensions

public static int? TryGetSourceLine(this TestResult testResult)
{
// See if the test runner provided it (never actually happens)
// See if it was provided directly (requires source information collection to be enabled)
if (testResult.TestCase.LineNumber > 0)
return testResult.TestCase.LineNumber;

// Try to extract it from the stack trace (works only if there was an exception)
return testResult.TryGetTestStackFrame()?.Line;
}

public static TestOutcome GetOverallOutcome(this IReadOnlyList<TestResult> testResults) =>
testResults.Any(r => r.Outcome == TestOutcome.Failed)
? TestOutcome.Failed
: testResults.Any(r => r.Outcome == TestOutcome.Passed)
? TestOutcome.Passed
: testResults.Any(r => r.Outcome == TestOutcome.Skipped)
? TestOutcome.Skipped
: TestOutcome.None;
}

0 comments on commit d52c8e9

Please sign in to comment.