Example #1
0
        public void ReadUnReleasedSectionWithJustAddedReturnsAddedSectionOnly(string version)
        {
            const string changeLog = @"# Changelog
All notable changes to this project will be documented in this file.

<!--
Please ADD ALL Changes to the UNRELEASED SECTION and not a specific release
-->

## [Unreleased]
### Added
- Something was added.
### Fixed
### Changed
### Removed
### Deployment Changes

<!--
Releases that have at least been deployed to staging, BUT NOT necessarily released to live.  Changes should be moved from [Unreleased] into here as they are merged into the appropriate release branch
-->
## [0.0.0] - Project created
";

            string result = ChangeLogReader.ExtractReleaseNotes(changeLog: changeLog, version: version);
            const string expected = @"### Added
- Something was added.";

            Assert.Equal(expected: expected, actual: result);
        }
Example #2
0
        public void ReadASpecificReleaseReturnsThatReleaseOnlyIgnoringZeroVersionParts(string version)
        {
            string result = ChangeLogReader.ExtractReleaseNotes(changeLog: MULTI_RELEASE_CHANGE_LOG, version: version);
            const string expected = @"### Added
- This is release 1.0.0.";
            Assert.Equal(expected: expected, actual: result);
        }
Example #3
0
        public void ReadASpecificReleaseReturnsThatReleaseOnly(string version)
        {
            string result = ChangeLogReader.ExtractReleaseNotes(changeLog: MULTI_RELEASE_CHANGE_LOG, version: version);
            const string expected = @"### Added
- Something was added here.";
            Assert.Equal(expected: expected, actual: result);
        }
Example #4
0
        public void ReadASpecificReleaseAtEndOfFile(string version)
        {
            string result = ChangeLogReader.ExtractReleaseNotes(changeLog: MULTI_RELEASE_CHANGE_LOG, version: version);

            const string expected = @"### Added
- Initial version";
            Assert.Equal(expected: expected, actual: result);
        }
Example #5
0
 public void ReadEmptyChangeLogReturnsEmpty(string version)
 {
     string result = ChangeLogReader.ExtractReleaseNotes(changeLog: string.Empty, version: version);
     Assert.Empty(result);
 }
Example #6
0
        public void ReadNonExistentVersion(string version)
        {
            string result = ChangeLogReader.ExtractReleaseNotes(changeLog: MULTI_RELEASE_CHANGE_LOG, version: version);

            Assert.Equal(expected: string.Empty, actual: result);
        }