public void ParseCommitParsesCommit() { string commitText = @"commit 307d8fe354ff30609decef49f91195e2e9719398 Author: David Fowler <*****@*****.**> Date: Thu Jul 7 19:05:40 2011 -0700 Initial commit"; ChangeSet changeSet = GitExeRepository.ParseCommit(commitText.AsReader()); Assert.Equal("307d8fe354ff30609decef49f91195e2e9719398", changeSet.Id); Assert.Equal("David Fowler", changeSet.AuthorName); Assert.Equal("*****@*****.**", changeSet.AuthorEmail); Assert.Equal("Initial commit", changeSet.Message); }
public void ParseCommitWithMultipleCommitsParsesOneCommit() { string commitText = @"commit d35697645e2472f5e327c0ec4b9f3489e806c276 Author: John Doe Date: Thu Jul 7 19:23:07 2011 -0700 Second commit commit 307d8fe354ff30609decef49f91195e2e9719398 Author: David Fowler <*****@*****.**> Date: Thu Jul 7 19:05:40 2011 -0700 Initial commit "; ChangeSet changeSet = GitExeRepository.ParseCommit(commitText.AsReader()); Assert.Equal("d35697645e2472f5e327c0ec4b9f3489e806c276", changeSet.Id); Assert.Equal("John Doe", changeSet.AuthorName); Assert.Null(changeSet.AuthorEmail); Assert.Equal(@"Second commit", changeSet.Message); }