Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2013-11-14 15:13:24 +0400
committernulltoken <emeric.fermas@gmail.com>2013-11-14 15:20:00 +0400
commit1ca809defed10f32b3594f5b226a7a8218ff5523 (patch)
tree02527eb78a041fb20067790e527348e0f4c7469a /LibGit2Sharp.Tests
parent9bfe5e43e8dd18caaceb3b33859c9c2b4b9357ab (diff)
Enforce Network.ListReferences() test coverage
This puts under the light that DirectReferences may point to GitObjects unknown from the local repository.
Diffstat (limited to 'LibGit2Sharp.Tests')
-rw-r--r--LibGit2Sharp.Tests/NetworkFixture.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/LibGit2Sharp.Tests/NetworkFixture.cs b/LibGit2Sharp.Tests/NetworkFixture.cs
index 870633aa..0cb03f46 100644
--- a/LibGit2Sharp.Tests/NetworkFixture.cs
+++ b/LibGit2Sharp.Tests/NetworkFixture.cs
@@ -22,7 +22,14 @@ namespace LibGit2Sharp.Tests
using (var repo = new Repository(repoPath))
{
Remote remote = repo.Network.Remotes.Add(remoteName, url);
- IEnumerable<DirectReference> references = repo.Network.ListReferences(remote);
+ IList<DirectReference> references = repo.Network.ListReferences(remote).ToList();
+
+ foreach (var directReference in references)
+ {
+ // None of those references point to an existing
+ // object in this brand new repository
+ Assert.Null(directReference.Target);
+ }
List<Tuple<string, string>> actualRefs = references.
Select(directRef => new Tuple<string, string>(directRef.CanonicalName, directRef.TargetIdentifier)).ToList();