diff options
author | nulltoken <emeric.fermas@gmail.com> | 2015-01-03 00:45:54 +0300 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2015-01-04 23:14:34 +0300 |
commit | 27fbde62110b2fb40f537ac14da620410fc0888e (patch) | |
tree | 713e2adc8f23a0d87d154dab5aafe3c4b2e9eef2 /LibGit2Sharp.Tests/NoteFixture.cs | |
parent | 7e5785871e4cebd3c18202263d8fb75a26e55eea (diff) |
Sandbox every test
Fix #826
Diffstat (limited to 'LibGit2Sharp.Tests/NoteFixture.cs')
-rw-r--r-- | LibGit2Sharp.Tests/NoteFixture.cs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/LibGit2Sharp.Tests/NoteFixture.cs b/LibGit2Sharp.Tests/NoteFixture.cs index d38f6723..7da99db0 100644 --- a/LibGit2Sharp.Tests/NoteFixture.cs +++ b/LibGit2Sharp.Tests/NoteFixture.cs @@ -15,7 +15,8 @@ namespace LibGit2Sharp.Tests [Fact] public void RetrievingNotesFromANonExistingGitObjectYieldsNoResult() { - using (var repo = new Repository(BareTestRepoPath)) + string path = SandboxBareTestRepo(); + using (var repo = new Repository(path)) { var notes = repo.Notes[ObjectId.Zero]; @@ -26,7 +27,8 @@ namespace LibGit2Sharp.Tests [Fact] public void RetrievingNotesFromAGitObjectWhichHasNoNoteYieldsNoResult() { - using (var repo = new Repository(BareTestRepoPath)) + string path = SandboxBareTestRepo(); + using (var repo = new Repository(path)) { var notes = repo.Notes[new ObjectId("4c062a6361ae6959e06292c1fa5e2822d9c96345")]; @@ -56,7 +58,8 @@ namespace LibGit2Sharp.Tests { var expectedMessages = new [] { "Just Note, don't you understand?\n", "Nope\n", "Not Nope, Note!\n" }; - using (var repo = new Repository(BareTestRepoPath)) + string path = SandboxBareTestRepo(); + using (var repo = new Repository(path)) { var notes = repo.Notes[new ObjectId("4a202b346bb0fb0db7eff3cffeb3c70babbd2045")]; @@ -68,7 +71,8 @@ namespace LibGit2Sharp.Tests [Fact] public void CanRetrieveASpecificNoteFromAKnownNamespace() { - using (var repo = new Repository(BareTestRepoPath)) + string path = SandboxBareTestRepo(); + using (var repo = new Repository(path)) { var singleNote = repo.Notes["answer", new ObjectId("4a202b346bb0fb0db7eff3cffeb3c70babbd2045")]; Assert.Equal("Nope\n", singleNote.Message); @@ -80,7 +84,8 @@ namespace LibGit2Sharp.Tests { var expectedNamespaces = new[] { "answer", "answer2", "commits", }; - using (var repo = new Repository(BareTestRepoPath)) + string path = SandboxBareTestRepo(); + using (var repo = new Repository(path)) { Assert.Equal(expectedNamespaces, repo.Notes.Namespaces.OrderBy(n => n, StringComparer.Ordinal).ToArray()); @@ -288,7 +293,8 @@ namespace LibGit2Sharp.Tests new { Blob = "1a550e416326cdb4a8e127a04dd69d7a01b11cf4", Target = "4a202b346bb0fb0db7eff3cffeb3c70babbd2045" }, }; - using (var repo = new Repository(BareTestRepoPath)) + string path = SandboxBareTestRepo(); + using (var repo = new Repository(path)) { Assert.Equal(expectedNotes, SortedNotes(repo.Notes["commits"], n => new { Blob = n.BlobId.Sha, Target = n.TargetObjectId.Sha })); |