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); }
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); }
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); }
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); }
public void Test1() { // Create a new collection and remember its ID. Collection collection = new Collection(store, "CS_TestCollection", store.DefaultDomain); try { // Commit the collection. collection.Commit(); // Create a change log reader. ChangeLogReader logReader = new ChangeLogReader(collection); // Get a cookie to track the event changes that we've seen. EventContext eventCookie = logReader.GetEventContext(); // Now start creating a bunch of collection events. Node[] nodeList = new Node[100]; for (int i = 0; i < 100; ++i) { nodeList[i] = new Node("CS_TestNode-" + i); } // Commit the changes. collection.Commit(nodeList); // Now get the events that have been generated. ArrayList changeList; bool moreData = logReader.GetEvents(eventCookie, out changeList); foreach (ChangeLogRecord rec in changeList) { Console.WriteLine("Found change: Record ID: {0}, TimeStamp: {1}, Operation: {2}, Node ID: {3}", rec.RecordID, rec.Epoch, rec.Operation, rec.EventID); } // Delete all of the node objects. collection.Commit(collection.Delete(nodeList)); // Get the delete events. moreData = logReader.GetEvents(eventCookie, out changeList); foreach (ChangeLogRecord rec in changeList) { Console.WriteLine("Found change: Record ID: {0}, TimeStamp: {1}, Operation: {2}, Node ID: {3}", rec.RecordID, rec.Epoch, rec.Operation, rec.EventID); } } finally { // Delete the collection. collection.Commit(collection.Delete()); } }
public void ReadEmptyChangeLogReturnsEmpty(string version) { string result = ChangeLogReader.ExtractReleaseNotes(changeLog: string.Empty, version: version); Assert.Empty(result); }
public void ReadNonExistentVersion(string version) { string result = ChangeLogReader.ExtractReleaseNotes(changeLog: MULTI_RELEASE_CHANGE_LOG, version: version); Assert.Equal(expected: string.Empty, actual: result); }