diff --git a/src/Credfeto.ChangeLog.Tests/AssemblySettings.cs b/src/Credfeto.ChangeLog.Tests/AssemblySettings.cs index 94c43b99..f9b1e40d 100644 --- a/src/Credfeto.ChangeLog.Tests/AssemblySettings.cs +++ b/src/Credfeto.ChangeLog.Tests/AssemblySettings.cs @@ -1,3 +1,7 @@ using System.Diagnostics.CodeAnalysis; +[assembly: + SuppressMessage(category: "Philips.CodeAnalysis.MaintainabilityAnalyzers", + checkId: "PH2140: Avoid ExcludeFromCodeCoverage", + Justification = "This is a unit test assembly - no need for coverage of the test code itself")] [assembly: ExcludeFromCodeCoverage] \ No newline at end of file diff --git a/src/Credfeto.ChangeLog/ChangeLogReader.cs b/src/Credfeto.ChangeLog/ChangeLogReader.cs index e725e83b..92a9d077 100644 --- a/src/Credfeto.ChangeLog/ChangeLogReader.cs +++ b/src/Credfeto.ChangeLog/ChangeLogReader.cs @@ -128,6 +128,9 @@ private static bool IsMatchingVersion(Version? version, string line) return StringComparer.InvariantCultureIgnoreCase.Equals(x: line, y: Constants.UnreleasedHeader); } + return Candidates(version) + .Any(candidate => line.StartsWith(value: candidate, comparisonType: StringComparison.OrdinalIgnoreCase)); + static IEnumerable Candidates(Version expected) { int build = expected.Build is 0 or -1 @@ -141,8 +144,5 @@ static IEnumerable Candidates(Version expected) yield return $"## [{expected.Major}.{expected.Minor}]"; } } - - return Candidates(version) - .Any(candidate => line.StartsWith(value: candidate, comparisonType: StringComparison.OrdinalIgnoreCase)); } } \ No newline at end of file