Skip to content

Commit 7b52706

Browse files
committed
Enhance repo.NetWork.Remotes.Add() test coverage
Fix #318
1 parent 09d4ed0 commit 7b52706

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

LibGit2Sharp.Tests/RemoteFixture.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,19 @@ public void CanAddANewRemoteWithAFetchRefSpec()
214214
}
215215
}
216216

217+
[Theory]
218+
[InlineData("sher.lock")]
219+
[InlineData("/")]
220+
public void AddingARemoteWithAnInvalidNameThrows(string name)
221+
{
222+
using (var repo = new Repository(BareTestRepoPath))
223+
{
224+
const string url = "https://github.com/libgit2/libgit2sharp.git";
225+
226+
Assert.Throws<InvalidSpecificationException>(() => repo.Network.Remotes.Add(name, url));
227+
}
228+
}
229+
217230
[Theory]
218231
[InlineData("valid/remote", true)]
219232
[InlineData("sher.lock", false)]

0 commit comments

Comments
 (0)