diff options
author | nulltoken <emeric.fermas@gmail.com> | 2011-06-05 21:51:08 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2011-06-05 21:51:08 +0400 |
commit | d76a80152e99653a6b5eef8df1af70705a82cc00 (patch) | |
tree | 9bfadb01223e6d86c46813521a5015b6ea220e82 | |
parent | 7be488569f8ef5452efb3d372a7c32c7901fc1eb (diff) |
Enforce test coverage of (fixed) copying behavior of TemporaryCloneOfTestRepo
-rw-r--r-- | LibGit2Sharp.Tests/IndexFixture.cs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/LibGit2Sharp.Tests/IndexFixture.cs b/LibGit2Sharp.Tests/IndexFixture.cs index abaf931c..835308bc 100644 --- a/LibGit2Sharp.Tests/IndexFixture.cs +++ b/LibGit2Sharp.Tests/IndexFixture.cs @@ -147,9 +147,10 @@ namespace LibGit2Sharp.Tests using (var repo = new Repository(path.RepositoryPath)) { var count = repo.Index.Count; - const string filename = "unit_test.txt"; + + const string filename = "new_untracked_file.txt"; string fullPath = Path.Combine(repo.Info.WorkingDirectory, filename); - File.WriteAllText(fullPath, "some contents"); + File.Exists(fullPath).ShouldBeTrue(); repo.Index.Stage(fullPath); @@ -184,13 +185,19 @@ namespace LibGit2Sharp.Tests [Test] public void CanUnstageANewFile() { - using (var repo = new Repository(Constants.TestRepoWithWorkingDirPath)) + using (var path = new TemporaryCloneOfTestRepo(Constants.TestRepoWithWorkingDirRootPath)) + using (var repo = new Repository(path.RepositoryPath)) { var count = repo.Index.Count; - repo.Index.Stage("new_untracked_file.txt"); + + const string filename = "new_untracked_file.txt"; + string fullPath = Path.Combine(repo.Info.WorkingDirectory, filename); + File.Exists(fullPath).ShouldBeTrue(); + + repo.Index.Stage(filename); repo.Index.Count.ShouldEqual(count + 1); - repo.Index.Unstage("new_untracked_file.txt"); + repo.Index.Unstage(filename); repo.Index.Count.ShouldEqual(count); } } |