public async Task EnsuresArgumentsNotNull() { var client = Substitute.For<IGitHubClient>(); var authEndpoint = new ObservableAuthorizationsClient(client); await Assert.ThrowsAsync<ArgumentNullException>(() => authEndpoint.GetAll(null).ToTask()); }
public void RequestsCorrectUrlWithApiOption() { var client = Substitute.For<IGitHubClient>(); var authEndpoint = new ObservableAuthorizationsClient(client); authEndpoint.GetAll(ApiOptions.None); client.Connection.Received(1).Get<List<Authorization>>(Arg.Is<Uri>(u => u.ToString() == "authorizations"), Arg.Is<Dictionary<string, string>>(dictionary => dictionary.Count == 0), null); }
public ObservableGitHubClient(IGitHubClient gitHubClient) { Ensure.ArgumentNotNull(gitHubClient, "githubClient"); _gitHubClient = gitHubClient; Authorization = new ObservableAuthorizationsClient(gitHubClient); Miscellaneous = new ObservableMiscellaneousClient(gitHubClient.Miscellaneous); Notification = new ObservableNotificationsClient(gitHubClient); Organization = new ObservableOrganizationsClient(gitHubClient); Repository = new ObservableRepositoriesClient(gitHubClient); SshKey = new ObservableSshKeysClient(gitHubClient); User = new ObservableUsersClient(gitHubClient); Release = new ObservableReleasesClient(gitHubClient); }
public ObservableGitHubClient(IGitHubClient gitHubClient) { Ensure.ArgumentNotNull(gitHubClient, "githubClient"); _gitHubClient = gitHubClient; Authorization = new ObservableAuthorizationsClient(gitHubClient); Activity = new ObservableActivitiesClient(gitHubClient); Issue = new ObservableIssuesClient(gitHubClient); Miscellaneous = new ObservableMiscellaneousClient(gitHubClient.Miscellaneous); Notification = new ObservableNotificationsClient(gitHubClient); Organization = new ObservableOrganizationsClient(gitHubClient); Repository = new ObservableRepositoriesClient(gitHubClient); SshKey = new ObservableSshKeysClient(gitHubClient); User = new ObservableUsersClient(gitHubClient); Release = new ObservableReleasesClient(gitHubClient); GitDatabase = new ObservableGitDatabaseClient(gitHubClient); Gist = new ObservableGistsClient(gitHubClient); Search = new ObservableSearchClient(gitHubClient); }
public ObservableGitHubClient(IGitHubClient gitHubClient) { Ensure.ArgumentNotNull(gitHubClient, "githubClient"); _gitHubClient = gitHubClient; Authorization = new ObservableAuthorizationsClient(gitHubClient); Activity = new ObservableActivitiesClient(gitHubClient); Issue = new ObservableIssuesClient(gitHubClient); Miscellaneous = new ObservableMiscellaneousClient(gitHubClient); Oauth = new ObservableOauthClient(gitHubClient); Organization = new ObservableOrganizationsClient(gitHubClient); PullRequest = new ObservablePullRequestsClient(gitHubClient); Repository = new ObservableRepositoriesClient(gitHubClient); User = new ObservableUsersClient(gitHubClient); Git = new ObservableGitDatabaseClient(gitHubClient); Gist = new ObservableGistsClient(gitHubClient); Search = new ObservableSearchClient(gitHubClient); Enterprise = new ObservableEnterpriseClient(gitHubClient); Migration = new ObservableMigrationClient(gitHubClient); Reaction = new ObservableReactionsClient(gitHubClient); }
// #LineComplexity: 1 public ObservableGitHubClient(IGitHubClient gitHubClient) { Ensure.ArgumentNotNull(gitHubClient, "githubClient"); _gitHubClient = gitHubClient; Authorization = new ObservableAuthorizationsClient(gitHubClient); Activity = new ObservableActivitiesClient(gitHubClient); Issue = new ObservableIssuesClient(gitHubClient); Miscellaneous = new ObservableMiscellaneousClient(gitHubClient); Oauth = new ObservableOauthClient(gitHubClient); Organization = new ObservableOrganizationsClient(gitHubClient); PullRequest = new ObservablePullRequestsClient(gitHubClient); Repository = new ObservableRepositoriesClient(gitHubClient); User = new ObservableUsersClient(gitHubClient); Git = new ObservableGitDatabaseClient(gitHubClient); Gist = new ObservableGistsClient(gitHubClient); Search = new ObservableSearchClient(gitHubClient); Enterprise = new ObservableEnterpriseClient(gitHubClient); Migration = new ObservableMigrationClient(gitHubClient); Reaction = new ObservableReactionsClient(gitHubClient); }
public ObservableAuthorizationsClientTests() { var github = Helper.GetBasicAuthClient(); _authorizationsClient = new ObservableAuthorizationsClient(github); }