-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AuthorDate to GitCommit/Log (#10)
* Add AuthorDate to GitCommit * Add AuthorDate to Log commit format * Add AuthorDate to ParseCommit * Update Commit tests
- Loading branch information
Showing
4 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,16 @@ public class CommitTests | |
public void ParseSingleParentCommit() | ||
{ | ||
const string GIT_OUTPUT_SINGLE_PARENT = "52c293a05038d865604c2284aa8698bd087915a1\n" | ||
+ "1234567\n" | ||
+ "[email protected]\n" | ||
+ "8e5a374372b8393906c7e380dbb09349c5385554\n" | ||
+ "This is a commit message."; | ||
|
||
var expected = new GitCommit("52c293a05038d865604c2284aa8698bd087915a1", | ||
"This is a commit message.", | ||
new[] { "8e5a374372b8393906c7e380dbb09349c5385554" }, | ||
"[email protected]"); | ||
"[email protected]", | ||
DateTimeOffset.FromUnixTimeSeconds(1234567)); | ||
var actual = GitParsing.ParseCommit(GIT_OUTPUT_SINGLE_PARENT); | ||
Assert.StrictEqual(expected, actual); | ||
} | ||
|
@@ -27,14 +29,16 @@ public void ParseSingleParentCommit() | |
public void ParseMultipleParentCommit() | ||
{ | ||
const string GIT_OUTPUT_MULTIPLE_PARENTS = "52c293a05038d865604c2284aa8698bd087915a1\n" | ||
+ "1234567\n" | ||
+ "[email protected]\n" | ||
+ "8e5a374372b8393906c7e380dbb09349c5385554 df27d8c75b129ab9b178b386077da2822101b217\n" | ||
+ "This is a commit message."; | ||
|
||
var expected = new GitCommit("52c293a05038d865604c2284aa8698bd087915a1", | ||
"This is a commit message.", | ||
new[] { "8e5a374372b8393906c7e380dbb09349c5385554", "df27d8c75b129ab9b178b386077da2822101b217" }, | ||
"[email protected]"); | ||
"[email protected]", | ||
DateTimeOffset.FromUnixTimeSeconds(1234567)); | ||
var actual = GitParsing.ParseCommit(GIT_OUTPUT_MULTIPLE_PARENTS); | ||
Assert.StrictEqual(expected, actual); | ||
} | ||
|
@@ -43,14 +47,16 @@ public void ParseMultipleParentCommit() | |
public void ParseNoParentCommit() | ||
{ | ||
const string GIT_OUTPUT_NO_PARENTS = "52c293a05038d865604c2284aa8698bd087915a1\n" | ||
+ "[email protected]\n" | ||
+ "\n" | ||
+ "This is a commit message."; | ||
+ "1234567\n" | ||
+ "[email protected]\n" | ||
+ "\n" | ||
+ "This is a commit message."; | ||
|
||
var expected = new GitCommit("52c293a05038d865604c2284aa8698bd087915a1", | ||
"This is a commit message.", | ||
null, | ||
"[email protected]"); | ||
"[email protected]", | ||
DateTimeOffset.FromUnixTimeSeconds(1234567)); | ||
var actual = GitParsing.ParseCommit(GIT_OUTPUT_NO_PARENTS); | ||
Assert.StrictEqual(expected, actual); | ||
} | ||
|