本文整理汇总了C#中Octokit.Reactive.ObservableReleasesClient类的典型用法代码示例。如果您正苦于以下问题:C# ObservableReleasesClient类的具体用法?C# ObservableReleasesClient怎么用?C# ObservableReleasesClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObservableReleasesClient类属于Octokit.Reactive命名空间,在下文中一共展示了ObservableReleasesClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ObservableRepositoriesClient
public ObservableRepositoriesClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");
_client = client.Repository;
_connection = client.Connection;
Status = new ObservableCommitStatusClient(client);
Hooks = new ObservableRepositoryHooksClient(client);
Forks = new ObservableRepositoryForksClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
RepoCollaborators = new ObservableRepoCollaboratorsClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
Collaborator = new ObservableRepoCollaboratorsClient(client);
Deployment = new ObservableDeploymentsClient(client);
Statistics = new ObservableStatisticsClient(client);
PullRequest = new ObservablePullRequestsClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
RepositoryComments = new ObservableRepositoryCommentsClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
Comment = new ObservableRepositoryCommentsClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
Commits = new ObservableRepositoryCommitsClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
Commit = new ObservableRepositoryCommitsClient(client);
Release = new ObservableReleasesClient(client);
DeployKeys = new ObservableRepositoryDeployKeysClient(client);
Content = new ObservableRepositoryContentsClient(client);
Merging = new ObservableMergingClient(client);
Page = new ObservableRepositoryPagesClient(client);
}
示例2: EnsuresNonNullArguments
public async Task EnsuresNonNullArguments()
{
var releasesClient = new ObservableReleasesClient(Substitute.For<IGitHubClient>());
await AssertEx.Throws<ArgumentNullException>(async () => await releasesClient.GetAll(null, "name"));
await AssertEx.Throws<ArgumentNullException>(async () => await releasesClient.GetAll("owner", null));
}
示例3: EnsuresNonNullArguments
public void EnsuresNonNullArguments()
{
var releasesClient = new ObservableReleasesClient(Substitute.For<IGitHubClient>());
Assert.Throws<ArgumentNullException>(() => releasesClient.GetAll(null, "name"));
Assert.Throws<ArgumentNullException>(() => releasesClient.GetAll("owner", null));
}
示例4: CallsIntoClient
public void CallsIntoClient()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableReleasesClient(gitHubClient);
client.GetLatest("fake", "repo");
gitHubClient.Repository.Release.Received(1).GetLatest("fake", "repo");
}
示例5: RequestsTheCorrectUrl
public void RequestsTheCorrectUrl()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableReleasesClient(gitHubClient);
client.Get("fake", "repo", 1);
gitHubClient.Connection.GetAsync<IReadOnlyList<Release>>(
new Uri("repos/fake/repo/releases/1", UriKind.Relative), null, null);
}
示例6: RequestsTheCorrectUrl
public void RequestsTheCorrectUrl()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableReleasesClient(gitHubClient);
client.GetAll("fake", "repo");
gitHubClient.Connection.Received(1).Get<List<Release>>(
new Uri("repos/fake/repo/releases", UriKind.Relative), Args.EmptyDictionary, null);
}
示例7: CallsIntoClient
public void CallsIntoClient()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var releasesClient = new ObservableReleasesClient(gitHubClient);
var data = new ReleaseUpdate("fake-tag");
releasesClient.CreateRelease("fake", "repo", data);
gitHubClient.Release.Received(1).CreateRelease("fake", "repo", data);
}
示例8: RequestsCorrectUrl
public void RequestsCorrectUrl()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var releasesClient = new ObservableReleasesClient(gitHubClient);
var data = new ReleaseUpdate("fake-tag");
releasesClient.CreateRelease("fake", "repo", data);
gitHubClient.Connection.PostAsync<Release>(
new Uri("repos/fake/repo/releases", UriKind.Relative), data, null, null);
}
示例9: ObservableGitHubClient
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);
}
示例10: RequestsTheCorrectUrlWithRepositoryIdWithApiOptions
public void RequestsTheCorrectUrlWithRepositoryIdWithApiOptions()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableReleasesClient(gitHubClient);
var options = new ApiOptions
{
PageCount = 1,
PageSize = 1,
StartPage = 1
};
client.GetAll(1, options);
gitHubClient.Connection.Received(1).Get<List<Release>>(
new Uri("repositories/1/releases", UriKind.Relative), Arg.Is<IDictionary<string, string>>(d => d.Count == 2), null);
}
示例11: ObservableGitHubClient
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);
}
示例12: ObservableRepositoriesClient
public ObservableRepositoriesClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");
_client = client.Repository;
_connection = client.Connection;
Status = new ObservableCommitStatusClient(client);
Hooks = new ObservableRepositoryHooksClient(client);
Forks = new ObservableRepositoryForksClient(client);
Collaborator = new ObservableRepoCollaboratorsClient(client);
Deployment = new ObservableDeploymentsClient(client);
Statistics = new ObservableStatisticsClient(client);
PullRequest = new ObservablePullRequestsClient(client);
Comment = new ObservableRepositoryCommentsClient(client);
Commit = new ObservableRepositoryCommitsClient(client);
Release = new ObservableReleasesClient(client);
DeployKeys = new ObservableRepositoryDeployKeysClient(client);
Content = new ObservableRepositoryContentsClient(client);
Merging = new ObservableMergingClient(client);
Page = new ObservableRepositoryPagesClient(client);
Invitation = new ObservableRepositoryInvitationsClient(client);
}
示例13: RequestsTheCorrectUrlWithRepositoryId
public void RequestsTheCorrectUrlWithRepositoryId()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var releasesClient = new ObservableReleasesClient(gitHubClient);
var data = new NewRelease("fake-tag");
releasesClient.Create(1, data);
gitHubClient.Repository.Release.Received(1).Create(1, data);
}
示例14: EnsuresArgumentsNotNull
public void EnsuresArgumentsNotNull()
{
var releasesClient = new ObservableReleasesClient(Substitute.For<IGitHubClient>());
var release = new Release("https://uploads.github.com/anything");
var uploadData = new ReleaseAssetUpload("good", "good/good", Stream.Null, null);
Assert.Throws<ArgumentNullException>(() => releasesClient.UploadAsset(null, uploadData));
Assert.Throws<ArgumentNullException>(() => releasesClient.UploadAsset(release, null));
}
示例15: RequestsTheCorrectUrlWithApiOptions
public void RequestsTheCorrectUrlWithApiOptions()
{
var expectedUrl = string.Format("repos/{0}/{1}/releases/1/assets", "fake", "repo");
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableReleasesClient(gitHubClient);
var options = new ApiOptions
{
StartPage = 1,
PageCount = 1,
PageSize = 1
};
client.GetAllAssets("fake", "repo", 1, options);
gitHubClient.Connection.Received(1).Get<List<ReleaseAsset>>(
Arg.Is<Uri>(u => u.ToString() == expectedUrl),
Arg.Is<IDictionary<string, string>>(dictionary => dictionary.Count == 2),
null);
}