private GetAllBranches ( long repositoryId ) : Task |
||
repositoryId | long | |
리턴 | Task |
public void ReturnsBranches() { var connection = Substitute.For<IApiConnection>(); var client = new RepositoriesClient(connection); client.GetAllBranches("owner", "name"); connection.Received() .GetAll<Branch>(Arg.Is<Uri>(u => u.ToString() == "repos/owner/name/branches")); }
public void EnsuresArguments() { var client = new RepositoriesClient(Substitute.For<IApiConnection>()); Assert.Throws<ArgumentNullException>(() => client.GetAllBranches(null, "repo")); Assert.Throws<ArgumentNullException>(() => client.GetAllBranches("owner", null)); Assert.Throws<ArgumentException>(() => client.GetAllBranches("", "repo")); Assert.Throws<ArgumentException>(() => client.GetAllBranches("owner", "")); }
public async Task<string> GetMasterTreeSha() { var client = new RepositoriesClient(apiConn); var branches = await client.GetAllBranches(Config.GitHubOwner, Config.GitHubRepo); return branches.First().Commit.Sha; }