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:
authorMarius Ungureanu <marius.ungureanu@xamarin.com>2014-05-31 01:08:04 +0400
committerMarius Ungureanu <marius.ungureanu@xamarin.com>2014-06-01 20:46:51 +0400
commitdcc5c673c22a7bd8b25905416ab6f093bde2f6df (patch)
treeb8866e4d806d8cdcf6cd22c4c44347d1503b856d /LibGit2Sharp.Tests
parent89ad06b61aea05ae14499ad4dc3a2039c20c6358 (diff)
Introduce RemoteCollection.Remove()
Diffstat (limited to 'LibGit2Sharp.Tests')
-rw-r--r--LibGit2Sharp.Tests/RemoteFixture.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/LibGit2Sharp.Tests/RemoteFixture.cs b/LibGit2Sharp.Tests/RemoteFixture.cs
index b25277fa..b3321349 100644
--- a/LibGit2Sharp.Tests/RemoteFixture.cs
+++ b/LibGit2Sharp.Tests/RemoteFixture.cs
@@ -189,5 +189,30 @@ namespace LibGit2Sharp.Tests
Assert.Equal("+refs/heads/*:refs/remotes/grmpf/*", remote.RefSpecs.Single().Specification);
}
}
+
+ [Fact]
+ public void CanDeleteExistingRemote()
+ {
+ var path = CloneStandardTestRepo();
+ using (var repo = new Repository(path))
+ {
+ Assert.NotNull(repo.Network.Remotes["origin"]);
+ Assert.NotEmpty(repo.Refs.FromGlob("refs/remotes/origin/*"));
+
+ repo.Network.Remotes.Remove("origin");
+ Assert.Null(repo.Network.Remotes["origin"]);
+ Assert.Empty(repo.Refs.FromGlob("refs/remotes/origin/*"));
+ }
+ }
+
+ [Fact]
+ public void CanDeleteNonExistingRemote()
+ {
+ using (var repo = new Repository(StandardTestRepoPath))
+ {
+ Assert.Null(repo.Network.Remotes["i_dont_exist"]);
+ repo.Network.Remotes.Remove("i_dont_exist");
+ }
+ }
}
}