Skip to content

Commit

Permalink
#719 Fixed badges in MarkdownAssembliesSummary report
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpalme committed Dec 21, 2024
1 parent 537c17c commit 6a2db6e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
Binary file modified docs/resources/SampleReports.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Summary

![Line coverage](https://img.shields.io/badge/lines-69.4%-C10909) ![Branch coverage](https://img.shields.io/badge/branches-50%-C10909) ![Method coverage](https://img.shields.io/badge/methods-66.6%-C10909)
![Line coverage](https://img.shields.io/badge/lines-69.4%25-C10909) ![Branch coverage](https://img.shields.io/badge/branches-50%25-C10909) ![Method coverage](https://img.shields.io/badge/methods-66.6%25-C10909)

|**Assembly**|**Line coverage**|**Branch coverage**|**Method coverage**|
|:---|---:|---:|---:|
Expand Down
1 change: 1 addition & 0 deletions src/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ CHANGELOG
5.4.2.0

* Fix: #700 Fixed handling of .netconfig files (sourceDirectories, reportTypes, plugins, assemblyFilters, etc.)
* Fix: #719 Fixed badges in MarkdownAssembliesSummary report

5.4.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void Dispose()
}

/// <summary>
/// Releases unmanaged and - optionally - managed resources
/// Releases unmanaged and - optionally - managed resources.
/// </summary>
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged ReportResources.</param>
protected virtual void Dispose(bool disposing)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,16 @@ public void CreateSummaryReport(SummaryResult summaryResult)

reportTextWriter.WriteLine();

reportTextWriter.Write($"![{ReportResources.Coverage}](https://img.shields.io/badge/lines-{(summaryResult.CoverageQuota.HasValue ? summaryResult.CoverageQuota.Value.ToString(CultureInfo.InvariantCulture) + "%" : "-")}-{(summaryResult.CoverageQuota.GetValueOrDefault() < 80 ? "C10909" : "0AAD0A")})");
reportTextWriter.Write($"![{ReportResources.Coverage}](https://img.shields.io/badge/lines-{(summaryResult.CoverageQuota.HasValue ? summaryResult.CoverageQuota.Value.ToString(CultureInfo.InvariantCulture) + "%25" : "-")}-{(summaryResult.CoverageQuota.GetValueOrDefault() < 80 ? "C10909" : "0AAD0A")})");

if (summaryResult.SupportsBranchCoverage)
{
reportTextWriter.Write($" ![{ReportResources.BranchCoverage}](https://img.shields.io/badge/branches-{(summaryResult.BranchCoverageQuota.HasValue ? summaryResult.BranchCoverageQuota.Value.ToString(CultureInfo.InvariantCulture) + "%" : "-")}-{(summaryResult.BranchCoverageQuota.GetValueOrDefault() < 80 ? "C10909" : "0AAD0A")})");
reportTextWriter.Write($" ![{ReportResources.BranchCoverage}](https://img.shields.io/badge/branches-{(summaryResult.BranchCoverageQuota.HasValue ? summaryResult.BranchCoverageQuota.Value.ToString(CultureInfo.InvariantCulture) + "%25" : "-")}-{(summaryResult.BranchCoverageQuota.GetValueOrDefault() < 80 ? "C10909" : "0AAD0A")})");
}

if (proVersion)
{
reportTextWriter.Write($" ![{ReportResources.CodeElementCoverageQuota}](https://img.shields.io/badge/methods-{(summaryResult.CodeElementCoverageQuota.HasValue ? summaryResult.CodeElementCoverageQuota.Value.ToString(CultureInfo.InvariantCulture) + "%" : "-")}-{(summaryResult.CodeElementCoverageQuota.GetValueOrDefault() < 80 ? "C10909" : "0AAD0A")})");
reportTextWriter.Write($" ![{ReportResources.CodeElementCoverageQuota}](https://img.shields.io/badge/methods-{(summaryResult.CodeElementCoverageQuota.HasValue ? summaryResult.CodeElementCoverageQuota.Value.ToString(CultureInfo.InvariantCulture) + "%25" : "-")}-{(summaryResult.CodeElementCoverageQuota.GetValueOrDefault() < 80 ? "C10909" : "0AAD0A")})");
}

reportTextWriter.WriteLine();
Expand Down

0 comments on commit 6a2db6e

Please sign in to comment.