From a992d2cb9c66a28e1a789184cd0f657cc7e2d57a Mon Sep 17 00:00:00 2001 From: Andreia Gaita Date: Fri, 21 Dec 2018 10:07:24 +0000 Subject: [PATCH] Fix some tests --- .../Process/ProcessManagerIntegrationTests.cs | 11 +++-- .../IO/LogEntryOutputProcessorTests.cs | 47 ++++++++++++++++++- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/src/tests/IntegrationTests/Process/ProcessManagerIntegrationTests.cs b/src/tests/IntegrationTests/Process/ProcessManagerIntegrationTests.cs index 9ab837f95..342d35088 100644 --- a/src/tests/IntegrationTests/Process/ProcessManagerIntegrationTests.cs +++ b/src/tests/IntegrationTests/Process/ProcessManagerIntegrationTests.cs @@ -46,8 +46,9 @@ public async Task LogEntriesTest() new GitLogEntry("018997938335742f8be694240a7c2b352ec0835f", "Author Person", "author@example.com", "Author Person", "author@example.com", - "Moving project files where they should be kept", - "Moving project files where they should be kept", firstCommitTime, + "Moving project files where they should be kept", + "", + firstCommitTime, firstCommitTime, new List { new GitStatusEntry("Assets/TestDocument.txt".ToNPath(), @@ -59,7 +60,8 @@ public async Task LogEntriesTest() "Author Person", "author@example.com", "Author Person", "author@example.com", "Initial Commit", - "Initial Commit", secondCommitTime, + "", + secondCommitTime, secondCommitTime, new List { new GitStatusEntry("TestDocument.txt".ToNPath(), @@ -87,7 +89,8 @@ public async Task RussianLogEntriesTest() "Author Person", "author@example.com", "Author Person", "author@example.com", "Я люблю github", - "Я люблю github", commitTime, + "", + commitTime, commitTime, new List { new GitStatusEntry(@"Assets\A new file.txt".ToNPath(), diff --git a/src/tests/UnitTests/IO/LogEntryOutputProcessorTests.cs b/src/tests/UnitTests/IO/LogEntryOutputProcessorTests.cs index 5c0bc3a5c..a24046922 100644 --- a/src/tests/UnitTests/IO/LogEntryOutputProcessorTests.cs +++ b/src/tests/UnitTests/IO/LogEntryOutputProcessorTests.cs @@ -46,9 +46,9 @@ public void ShouldParseSingleCommit() { new GitLogEntry("1cd4b9154a88bc8c7b09cb8cacc79bf1d5bde8cf", "Author Person", "author@example.com", - "Author Person", "author@example.com", - "Rename RepositoryModelBase to RepositoryModel", + "Author Person", "author@example.com", "Rename RepositoryModelBase to RepositoryModel", + "", commitTime, commitTime, new List { @@ -61,6 +61,49 @@ public void ShouldParseSingleCommit() AssertProcessOutput(output, expected); } + [Test] + public void ShouldParseSummaryAndDescription() + { + var output = new[] + { + "1cd4b9154a88bc8c7b09cb8cacc79bf1d5bde8cf", + "865b8d9d6e5e3bd6d7a4dc9c9f3588192314942c", + "Author Person", + "author@example.com", + "2017-01-06T15:36:57+01:00", + "Author Person", + "author@example.com", + "2017-01-06T15:36:57+01:00", + "Rename RepositoryModelBase to RepositoryModel", + "", + "This is a line on the description", + "---GHUBODYEND---", + "M src/GitHub.App/Models/RemoteRepositoryModel.cs", + null, + }; + + var commitTime = new DateTimeOffset(2017, 1, 6, 15, 36, 57, TimeSpan.FromHours(1)); + + var expected = new[] + { + new GitLogEntry("1cd4b9154a88bc8c7b09cb8cacc79bf1d5bde8cf", + "Author Person", "author@example.com", + "Author Person", "author@example.com", + "Rename RepositoryModelBase to RepositoryModel", + "This is a line on the description", + commitTime, + commitTime, + new List + { + new GitStatusEntry("src/GitHub.App/Models/RemoteRepositoryModel.cs", + TestRootPath + @"\src/GitHub.App/Models/RemoteRepositoryModel.cs", null, + GitFileStatus.Modified), + }) + }; + + AssertProcessOutput(output, expected); + } + private void AssertProcessOutput(IEnumerable lines, GitLogEntry[] expected) { var gitObjectFactory = SubstituteFactory.CreateGitObjectFactory(TestRootPath);