public Edit ( long repositoryId, Octokit.RepositoryUpdate update ) : Task |
||
repositoryId | long | The Id of the repository |
update | Octokit.RepositoryUpdate | New values to update the repository with |
Результат | Task |
public void EnsuresNonNullArguments() { var client = new RepositoriesClient(Substitute.For<IApiConnection>()); var update = new RepositoryUpdate(); Assert.Throws<ArgumentNullException>(() => client.Edit(null, "repo", update)); Assert.Throws<ArgumentNullException>(() => client.Edit("owner", null, update)); Assert.Throws<ArgumentNullException>(() => client.Edit("owner", "repo", null)); Assert.Throws<ArgumentException>(() => client.Edit("", "repo", update)); Assert.Throws<ArgumentException>(() => client.Edit("owner", "", update)); }
public void PatchesCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new RepositoriesClient(connection); var update = new RepositoryUpdate(); client.Edit("owner", "repo", update); connection.Received() .Patch<Repository>(Arg.Is<Uri>(u => u.ToString() == "repos/owner/repo"), Arg.Any<RepositoryUpdate>()); }