diff --git a/source/Nuke.Common.Tests/ChangelogReferenceFiles/changelog_reference_NUKE_variant_1.md b/source/Nuke.Common.Tests/ChangelogReferenceFiles/changelog_reference_NUKE_variant_1.md new file mode 100644 index 000000000..d119cc9d4 --- /dev/null +++ b/source/Nuke.Common.Tests/ChangelogReferenceFiles/changelog_reference_NUKE_variant_1.md @@ -0,0 +1,22 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [vNext] + +## [1.2.3] / 2022-01-02 +- Added something +- Fixed something + +## [1.2.2] / 2022-01-01 +- Fixed something + +## [0.2.0] / 2020-03-17 +- Added something + +## [0.1.0] / 2019-03-23 +- Added something + +Some text at the end of the changelog \ No newline at end of file diff --git a/source/Nuke.Common.Tests/ChangelogReferenceFiles/changelog_reference_NUKE_variant_1.verified.txt b/source/Nuke.Common.Tests/ChangelogReferenceFiles/changelog_reference_NUKE_variant_1.verified.txt new file mode 100644 index 000000000..c2b49667d --- /dev/null +++ b/source/Nuke.Common.Tests/ChangelogReferenceFiles/changelog_reference_NUKE_variant_1.verified.txt @@ -0,0 +1,57 @@ +[ + { + IsEmpty: true, + Unreleased: true, + Notes: [ + + ], + StartIndex: 6, + EndIndex: 7 + }, + { + IsEmpty: false, + Unreleased: false, + Version: 1.2.3, + Notes: [ + - Added something, + - Fixed something, + + ], + StartIndex: 8, + EndIndex: 11 + }, + { + IsEmpty: false, + Unreleased: false, + Version: 1.2.2, + Notes: [ + - Fixed something, + + ], + StartIndex: 12, + EndIndex: 14 + }, + { + IsEmpty: false, + Unreleased: false, + Version: 0.2.0, + Notes: [ + - Added something, + + ], + StartIndex: 15, + EndIndex: 17 + }, + { + IsEmpty: false, + Unreleased: false, + Version: 0.1.0, + Notes: [ + - Added something, + , + Some text at the end of the changelog + ], + StartIndex: 18, + EndIndex: 21 + } +] \ No newline at end of file diff --git a/source/Nuke.Common.Tests/ChangelogReferenceFiles/changelog_reference_NUKE_variant_2.md b/source/Nuke.Common.Tests/ChangelogReferenceFiles/changelog_reference_NUKE_variant_2.md new file mode 100644 index 000000000..b9ee3f660 --- /dev/null +++ b/source/Nuke.Common.Tests/ChangelogReferenceFiles/changelog_reference_NUKE_variant_2.md @@ -0,0 +1,23 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [vNext] +- Changed something + +## [1.0.0] / 2022-01-02 +- Some text that spans + multiple lines +- A text on a single line + +- Added something +- Fixed something + +## [0.1.0] / 2019-03-23 +- Added something + +- Fixed something + +Some text at the end of the changelog \ No newline at end of file diff --git a/source/Nuke.Common.Tests/ChangelogReferenceFiles/changelog_reference_NUKE_variant_2.verified.txt b/source/Nuke.Common.Tests/ChangelogReferenceFiles/changelog_reference_NUKE_variant_2.verified.txt new file mode 100644 index 000000000..8e7ed6050 --- /dev/null +++ b/source/Nuke.Common.Tests/ChangelogReferenceFiles/changelog_reference_NUKE_variant_2.verified.txt @@ -0,0 +1,42 @@ +[ + { + IsEmpty: false, + Unreleased: true, + Notes: [ + - Changed something, + + ], + StartIndex: 6, + EndIndex: 8 + }, + { + IsEmpty: false, + Unreleased: false, + Version: 1.0.0, + Notes: [ + - Some text that spans, + multiple lines, + - A text on a single line, + , + - Added something, + - Fixed something, + + ], + StartIndex: 9, + EndIndex: 16 + }, + { + IsEmpty: false, + Unreleased: false, + Version: 0.1.0, + Notes: [ + - Added something, + , + - Fixed something, + , + Some text at the end of the changelog + ], + StartIndex: 17, + EndIndex: 22 + } +] \ No newline at end of file diff --git a/source/Nuke.Common.Tests/ChangelogTasksTest.cs b/source/Nuke.Common.Tests/ChangelogTasksTest.cs index 6c4d7cfc2..8aafbb7af 100644 --- a/source/Nuke.Common.Tests/ChangelogTasksTest.cs +++ b/source/Nuke.Common.Tests/ChangelogTasksTest.cs @@ -24,6 +24,7 @@ public class ChangelogTasksTest [Theory] [MemberData(nameof(AllChangelogReference_1_0_0_Files))] + [MemberData(nameof(AllChangelogReference_NUKE_Files))] public void ReadReleaseNotes_ChangelogReferenceFile_ThrowsNoExceptions(AbsolutePath file) { Action act = () => ChangelogTasks.ReadReleaseNotes(file); @@ -33,6 +34,7 @@ public void ReadReleaseNotes_ChangelogReferenceFile_ThrowsNoExceptions(AbsoluteP [Theory] [MemberData(nameof(AllChangelogReference_1_0_0_Files))] + [MemberData(nameof(AllChangelogReference_NUKE_Files))] public void ReadReleaseNotes_ChangelogReferenceFile_ReturnsAnyReleaseNotes(AbsolutePath file) { var releaseNotes = ChangelogTasks.ReadReleaseNotes(file); @@ -42,6 +44,7 @@ public void ReadReleaseNotes_ChangelogReferenceFile_ReturnsAnyReleaseNotes(Absol [Theory] [MemberData(nameof(AllChangelogReference_1_0_0_Files))] + [MemberData(nameof(AllChangelogReference_NUKE_Files))] public void ReadChangelog_ChangelogReferenceFile_ThrowsNoExceptions(AbsolutePath file) { Action act = () => ChangelogTasks.ReadChangelog(file); @@ -51,6 +54,7 @@ public void ReadChangelog_ChangelogReferenceFile_ThrowsNoExceptions(AbsolutePath [Theory] [MemberData(nameof(AllChangelogReference_1_0_0_Files))] + [MemberData(nameof(AllChangelogReference_NUKE_Files))] public void ExtractChangelogSectionNotes_ChangelogReferenceFile_ThrowsNoExceptions(AbsolutePath file) { Action act = () => ChangelogTasks.ExtractChangelogSectionNotes(file); @@ -60,6 +64,7 @@ public void ExtractChangelogSectionNotes_ChangelogReferenceFile_ThrowsNoExceptio [Theory] [MemberData(nameof(AllChangelogReference_1_0_0_Files))] + [MemberData(nameof(AllChangelogReference_NUKE_Files))] public Task ReadReleaseNotes_ChangelogReferenceFile_HasParsedCorrectly(AbsolutePath file) { var releaseNotes = ChangelogTasks.ReadReleaseNotes(file); @@ -126,5 +131,11 @@ public static IEnumerable AllChangelogReference_1_0_0_Files { get => PathToChangelogReferenceFiles.GlobFiles("changelog_reference_1.0.0*.md").Select(file => new object[] { file }); } + + [UsedImplicitly] + public static IEnumerable AllChangelogReference_NUKE_Files + { + get => PathToChangelogReferenceFiles.GlobFiles("changelog_reference_NUKE*.md").Select(file => new object[] { file }); + } } }