diff options
author | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2014-05-31 01:08:04 +0400 |
---|---|---|
committer | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2014-06-01 20:46:51 +0400 |
commit | dcc5c673c22a7bd8b25905416ab6f093bde2f6df (patch) | |
tree | b8866e4d806d8cdcf6cd22c4c44347d1503b856d /LibGit2Sharp.Tests | |
parent | 89ad06b61aea05ae14499ad4dc3a2039c20c6358 (diff) |
Introduce RemoteCollection.Remove()
Diffstat (limited to 'LibGit2Sharp.Tests')
-rw-r--r-- | LibGit2Sharp.Tests/RemoteFixture.cs | 25 |
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"); + } + } } } |