Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shana committed Jan 9, 2019
1 parent 4cd00a6 commit a992d2c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<GitStatusEntry>
{
new GitStatusEntry("Assets/TestDocument.txt".ToNPath(),
Expand All @@ -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<GitStatusEntry>
{
new GitStatusEntry("TestDocument.txt".ToNPath(),
Expand Down Expand Up @@ -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<GitStatusEntry>
{
new GitStatusEntry(@"Assets\A new file.txt".ToNPath(),
Expand Down
47 changes: 45 additions & 2 deletions src/tests/UnitTests/IO/LogEntryOutputProcessorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GitStatusEntry>
{
Expand All @@ -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<GitStatusEntry>
{
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<string> lines, GitLogEntry[] expected)
{
var gitObjectFactory = SubstituteFactory.CreateGitObjectFactory(TestRootPath);
Expand Down

0 comments on commit a992d2c

Please sign in to comment.