diff options
author | Saaman <romain.magny@gmail.com> | 2013-05-14 23:49:50 +0400 |
---|---|---|
committer | Saaman <romain.magny@gmail.com> | 2013-05-23 19:09:24 +0400 |
commit | 7eba13d90f0f19477db4018cb675367c09afd6bf (patch) | |
tree | 85856941d5558f3288f1bc521cf3d50877ea7b20 /LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs | |
parent | 5331dead980209031d3fa06f31aab0d8d2afa2f5 (diff) |
Move AssertReflogEntryIsCreated to BaseFixture
Diffstat (limited to 'LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs')
-rw-r--r-- | LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs b/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs index 2158b590..fdedac60 100644 --- a/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs +++ b/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; using System.Text.RegularExpressions; using LibGit2Sharp.Core; @@ -221,5 +222,21 @@ namespace LibGit2Sharp.Tests.TestHelpers return file; } + + protected static void AssertReflogEntryIsCreated(IEnumerable<ReflogEntry> reflog, string targetSha, + string logMessage, string fromSha = null) + { + var reflogEntry = reflog.First(); + + if (!string.IsNullOrEmpty(fromSha)) + { + Assert.Equal(fromSha, reflogEntry.From.Sha); + } + + Assert.Equal(targetSha, reflogEntry.To.Sha); + Assert.NotNull(reflogEntry.Commiter.Email); + Assert.NotNull(reflogEntry.Commiter.Name); + Assert.Equal(logMessage, reflogEntry.Message); + } } } |