• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IssuesClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IssuesClient的典型用法代码示例。如果您正苦于以下问题:C# IssuesClient类的具体用法?C# IssuesClient怎么用?C# IssuesClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IssuesClient类属于命名空间,在下文中一共展示了IssuesClient类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: EnsuresNonNullArguments

            public async Task EnsuresNonNullArguments()
            {
                var client = new IssuesClient(Substitute.For<IApiConnection>());

                await AssertEx.Throws<ArgumentNullException>(async () => await client.Get(null, "name", 1));
                await AssertEx.Throws<ArgumentNullException>(async () => await client.Get("owner", null, 1));
            }
开发者ID:nigel-sampson,项目名称:octokit.net,代码行数:7,代码来源:IssuesClientTests.cs


示例2: RequestsCorrectUrl

            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                client.Get("fake", "repo", 42);

                connection.Received().Get<Issue>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42"));
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:9,代码来源:IssuesClientTests.cs


示例3: EnsuresNonNullArguments

            public async Task EnsuresNonNullArguments()
            {
                var client = new IssuesClient(Substitute.For<IApiConnection>());

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForOwnedAndMemberRepositories((ApiOptions)null));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForOwnedAndMemberRepositories((IssueRequest)null));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForOwnedAndMemberRepositories(null, new ApiOptions()));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForOwnedAndMemberRepositories(new IssueRequest(), null));
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:9,代码来源:IssuesClientTests.cs


示例4: RequestsCorrectUrl

            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                client.GetAllForOwnedAndMemberRepositories();

                connection.Received().GetAll<Issue>(Arg.Is<Uri>(u => u.ToString() == "user/issues"),
                    Arg.Any<Dictionary<string, string>>());
            }
开发者ID:nigel-sampson,项目名称:octokit.net,代码行数:10,代码来源:IssuesClientTests.cs


示例5: RequestsCorrectUrlWithRepositoryId

            public async Task RequestsCorrectUrlWithRepositoryId()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                await client.Get(1, 42);

                connection.Received().Get<Issue>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42"),
                    Arg.Any<Dictionary<string, string>>(),
                    "application/vnd.github.squirrel-girl-preview");
            }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:11,代码来源:IssuesClientTests.cs


示例6: RequestsCorrectUrl

            public async Task RequestsCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                await client.GetAllForCurrent();

                connection.Received().GetAll<Issue>(Arg.Is<Uri>(u => u.ToString() == "issues"),
                    Arg.Any<Dictionary<string, string>>(),
                    "application/vnd.github.squirrel-girl-preview",
                    Args.ApiOptions);
            }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:12,代码来源:IssuesClientTests.cs


示例7: SendsAppropriateParameters

            public void SendsAppropriateParameters()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                client.GetAllForCurrent(new IssueRequest { SortDirection = SortDirection.Ascending });

                connection.Received().GetAll<Issue>(Arg.Is<Uri>(u => u.ToString() == "issues"),
                    Arg.Is<Dictionary<string, string>>(d => d.Count == 4
                        && d["filter"] == "assigned"
                        && d["sort"] == "created"
                        && d["state"] == "open"
                        && d["direction"] == "asc"));
            }
开发者ID:nigel-sampson,项目名称:octokit.net,代码行数:14,代码来源:IssuesClientTests.cs


示例8: SendsAppropriateParameters

            public async Task SendsAppropriateParameters()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                await client.GetAllForCurrent(new IssueRequest { SortDirection = SortDirection.Ascending });

                connection.Received().GetAll<Issue>(Arg.Is<Uri>(u => u.ToString() == "issues"),
                    Arg.Is<Dictionary<string, string>>(d => d.Count == 4
                        && d["filter"] == "assigned"
                        && d["sort"] == "created"
                        && d["state"] == "open"
                        && d["direction"] == "asc"),
                    "application/vnd.github.squirrel-girl-preview",
                    Args.ApiOptions);
            }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:16,代码来源:IssuesClientTests.cs


示例9: PostsToCorrectUrl

            public void PostsToCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                client.Unlock("fake", "repo", 42);

                connection.Received().Delete(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42/lock"), Arg.Any<object>(), Arg.Is<string>(u => u.ToString() == "application/vnd.github.the-key-preview+json"));
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:9,代码来源:IssuesClientTests.cs


示例10: SendsAppropriateParametersWithRepositoryIdWithApiOptions

            public async Task SendsAppropriateParametersWithRepositoryIdWithApiOptions()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                var options = new ApiOptions
                {
                    PageCount = 1,
                    StartPage = 1,
                    PageSize = 1
                };

                await client.GetAllForRepository(1, new RepositoryIssueRequest
                {
                    SortDirection = SortDirection.Ascending
                }, options);

                connection.Received().GetAll<Issue>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues"),
                    Arg.Is<Dictionary<string, string>>(d => d.Count == 4
                        && d["state"] == "open"
                        && d["direction"] == "asc"
                        && d["sort"] == "created"
                        && d["filter"] == "assigned"),
                    "application/vnd.github.squirrel-girl-preview",
                    options);
            }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:26,代码来源:IssuesClientTests.cs


示例11: EnsuresArgumentsNotNull

            public async Task EnsuresArgumentsNotNull()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.Update(null, "name", 1, new IssueUpdate()));
                await Assert.ThrowsAsync<ArgumentException>(() => client.Update("", "name", 1, new IssueUpdate()));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.Update("owner", null, 1, new IssueUpdate()));
                await Assert.ThrowsAsync<ArgumentException>(() => client.Update("owner", "", 1, new IssueUpdate()));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.Update("owner", "name", 1, null));
            }
开发者ID:nigel-sampson,项目名称:octokit.net,代码行数:11,代码来源:IssuesClientTests.cs


示例12: PostsToCorrectUrl

            public void PostsToCorrectUrl()
            {
                var issueUpdate = new IssueUpdate();
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                client.Update("fake", "repo", 42, issueUpdate);

                connection.Received().Patch<Issue>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/42"),
                    issueUpdate);
            }
开发者ID:nigel-sampson,项目名称:octokit.net,代码行数:11,代码来源:IssuesClientTests.cs


示例13: BernieHttpClient

 public BernieHttpClient(IssuesClient issuesClient, NewsClient newsClient)
 {
     _issuesClient = issuesClient;
     _newsClient = newsClient;
 }
开发者ID:ItzWarty,项目名称:BernieAppWindows,代码行数:5,代码来源:BernieHttpClient.cs


示例14: EnsuresArgumentsNotNull

            public void EnsuresArgumentsNotNull()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                Assert.Throws<ArgumentNullException>(() => client.Create(null, "name", new NewIssue("title")));
                Assert.Throws<ArgumentException>(() => client.Create("", "name", new NewIssue("x")));
                Assert.Throws<ArgumentNullException>(() => client.Create("owner", null, new NewIssue("x")));
                Assert.Throws<ArgumentException>(() => client.Create("owner", "", new NewIssue("x")));
                Assert.Throws<ArgumentNullException>(() => client.Create("owner", "name", null));
            }
开发者ID:KimCM,项目名称:octokit.net,代码行数:11,代码来源:IssuesClientTests.cs


示例15: PostsToCorrectUrlWithRepositoryId

            public void PostsToCorrectUrlWithRepositoryId()
            {
                var issueUpdate = new IssueUpdate();
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                client.Update(1, 42, issueUpdate);

                connection.Received().Patch<Issue>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues/42"),
                    issueUpdate);
            }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:11,代码来源:IssuesClientTests.cs


示例16: RequestsCorrectUrlWithRepositoryIdWithApiOptions

            public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                var options = new ApiOptions
                {
                    PageCount = 1,
                    StartPage = 1,
                    PageSize = 1
                };

                await client.GetAllForRepository(1, options);

                connection.Received().GetAll<Issue>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/issues"),
                    Arg.Any<Dictionary<string, string>>(),
                    "application/vnd.github.squirrel-girl-preview",
                    options);
            }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:19,代码来源:IssuesClientTests.cs


示例17: EnsuresArgumentsNotNull

            public async Task EnsuresArgumentsNotNull()
            {
                var client = new IssuesClient(Substitute.For<IApiConnection>());

                var options = new ApiOptions();
                var request = new RepositoryIssueRequest();

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForRepository(null, "name"));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForRepository(null, "name", options));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForRepository(null, "name", request));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForRepository(null, "name", request, options));

                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForRepository("", "name"));
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForRepository("", "name", options));
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForRepository("", "name", request));
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForRepository("", "name", request, options));

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForRepository("owner", null));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForRepository("owner", null, options));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForRepository("owner", null, request));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForRepository("owner", null, request, options));

                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForRepository("owner", ""));
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForRepository("owner", "", options));
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForRepository("owner", "", request));
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForRepository("owner", "", request, options));

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForRepository("owner", "name", (ApiOptions)null));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForRepository("owner", "name", (RepositoryIssueRequest)null));

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForRepository("owner", "name", null, options));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForRepository("owner", "name", request, null));
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:33,代码来源:IssuesClientTests.cs


示例18: EnsuresNonNullArguments

            public async Task EnsuresNonNullArguments()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new IssuesClient(connection);

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.Unlock(null, "name", 1));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.Unlock("owner", null, 1));

                await Assert.ThrowsAsync<ArgumentException>(() => client.Unlock("", "name", 1));
                await Assert.ThrowsAsync<ArgumentException>(() => client.Unlock("owner", "", 1));
            }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:11,代码来源:IssuesClientTests.cs



注:本文中的IssuesClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Item类代码示例发布时间:2022-05-24
下一篇:
C# Issue类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap