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>2011-06-05 21:51:08 +0400
committernulltoken <emeric.fermas@gmail.com>2011-06-05 21:51:08 +0400
commitd76a80152e99653a6b5eef8df1af70705a82cc00 (patch)
tree9bfadb01223e6d86c46813521a5015b6ea220e82
parent7be488569f8ef5452efb3d372a7c32c7901fc1eb (diff)
Enforce test coverage of (fixed) copying behavior of TemporaryCloneOfTestRepo
-rw-r--r--LibGit2Sharp.Tests/IndexFixture.cs17
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);
}
}