private GetBranch ( long repositoryId, string branchName ) : Task |
||
repositoryId | long | |
branchName | string | |
Résultat | Task |
public void EnsuresNonNullArguments() { var client = new RepositoriesClient(Substitute.For<IApiConnection>()); Assert.Throws<ArgumentNullException>(() => client.GetBranch(null, "repo", "branch")); Assert.Throws<ArgumentNullException>(() => client.GetBranch("owner", null, "branch")); Assert.Throws<ArgumentNullException>(() => client.GetBranch("owner", "repo", null)); Assert.Throws<ArgumentException>(() => client.GetBranch("", "repo", "branch")); Assert.Throws<ArgumentException>(() => client.GetBranch("owner", "", "branch")); Assert.Throws<ArgumentException>(() => client.GetBranch("owner", "repo", "")); }
public void GetsCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new RepositoriesClient(connection); client.GetBranch("owner", "repo", "branch"); connection.Received() .Get<Branch>(Arg.Is<Uri>(u => u.ToString() == "repos/owner/repo/branches/branch"), null); }