public async Task EnsuresNonEmptyArguments() { var connection = Substitute.For <IApiConnection>(); var client = new GitHubAppsClient(connection); await Assert.ThrowsAsync <ArgumentException>(() => client.GetRepositoryInstallationForCurrent("", "ducks")); await Assert.ThrowsAsync <ArgumentException>(() => client.GetRepositoryInstallationForCurrent("mighty", "")); }
public void GetsFromCorrectUrlByRepositoryId() { var connection = Substitute.For <IApiConnection>(); var client = new GitHubAppsClient(connection); client.GetRepositoryInstallationForCurrent(1234); connection.Received().Get <Installation>(Arg.Is <Uri>(u => u.ToString() == "repositories/1234/installation"), null, "application/vnd.github.machine-man-preview+json"); }