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

C# TeamsClient类代码示例

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

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



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

示例1: EnsuresNonNullArguments

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

                await Assert.ThrowsAsync<ArgumentNullException>(() => teams.GetAll(null));
                await Assert.ThrowsAsync<ArgumentNullException>(() => teams.GetAll("orgName", null));
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:7,代码来源:TeamsClientTests.cs


示例2: RequestsTheCorrectlUrl

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

                client.Get(1);

                connection.Received().Get<Team>(Arg.Is<Uri>(u => u.ToString() == "teams/1"), null);
            }
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:9,代码来源:TeamsClientTests.cs


示例3: RequestsTheCorrectUrl

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

                client.GetAll("orgName");

                connection.Received().GetAll<Team>(Arg.Is<Uri>(u => u.ToString() == "orgs/orgName/teams"));
            }
开发者ID:ricardodsanchez,项目名称:octokit.net,代码行数:9,代码来源:TeamsClientTests.cs


示例4: EnsuresNonNullArguments

            public void EnsuresNonNullArguments()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new TeamsClient(connection);
                var team = new NewTeam("superstars");

                Assert.Throws<ArgumentNullException>(() => client.Create(null, team));
                Assert.Throws<ArgumentException>(() => client.Create("", team));
                Assert.Throws<ArgumentNullException>(() => client.Create("name", null));
            }
开发者ID:ricardodsanchez,项目名称:octokit.net,代码行数:10,代码来源:TeamsClientTests.cs


示例5: RequestsTheCorrectUrl

            public void RequestsTheCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new TeamsClient(connection);
                var team = new UpdateTeam("Octokittens");

                client.UpdateTeam(1, team);

                connection.Received().Patch<Team>(Arg.Is<Uri>(u => u.ToString() == "teams/1"), team);
            }
开发者ID:rahulvramesh,项目名称:octokit.net,代码行数:10,代码来源:TeamsClientTests.cs


示例6: EnsuresNonNullArguments

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

                AssertEx.Throws<ArgumentNullException>(async () => await
                    client.CreateTeam("", new NewTeam("superstars")));
                AssertEx.Throws<ArgumentException>(async () => await
                    client.CreateTeam("name", null));
            }
开发者ID:rahulvramesh,项目名称:octokit.net,代码行数:10,代码来源:TeamsClientTests.cs


示例7: EnsuresNonEmptyLogin

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

                AssertEx.Throws<ArgumentException>(() => client.IsMember(1, ""));
            }
开发者ID:ricardodsanchez,项目名称:octokit.net,代码行数:7,代码来源:TeamsClientTests.cs


示例8: RequestsTheCorrectUrl

            public async Task RequestsTheCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();

                var client = new TeamsClient(connection);

                await client.AddMembership(1, "user");

                connection.Received().Put<Dictionary<string, string>>(
                    Arg.Is<Uri>(u => u.ToString() == "teams/1/memberships/user"),
                    Args.Object);
            }
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:12,代码来源:TeamsClientTests.cs


示例9: RequestsTheCorrectUrl

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

                client.GetAllForCurrent();

                connection.Received().GetAll<Team>(
                    Arg.Is<Uri>(u => u.ToString() == "user/teams"),
                    Args.ApiOptions);
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:11,代码来源:TeamsClientTests.cs


示例10: EnsuresNonNullOrEmptyArguments

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

                // Check owner arguments.
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.RemoveRepository(1, null, "repoName"));
                await Assert.ThrowsAsync<ArgumentException>(() => client.RemoveRepository(1, "", "repoName"));

                // Check repo arguments.
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.RemoveRepository(1, "ownerName", null));
                await Assert.ThrowsAsync<ArgumentException>(() => client.RemoveRepository(1, "ownerName", ""));
            }
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:13,代码来源:TeamsClientTests.cs


示例11: AddOrUpdatePermission

            public void AddOrUpdatePermission()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new TeamsClient(connection);
                var newPermission = new RepositoryPermissionRequest(Permission.Admin);

                client.AddRepository(1, "org", "repo", newPermission);

                connection.Connection.Received().Put<HttpStatusCode>(Arg.Is<Uri>(u => u.ToString() == "teams/1/repos/org/repo"), Arg.Any<object>(), "", "application/vnd.github.ironman-preview+json");
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:10,代码来源:TeamsClientTests.cs


示例12: EnsuresNonNullOrEmptyLogin

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

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.RemoveMembership(1, null));
                await Assert.ThrowsAsync<ArgumentException>(() => client.RemoveMembership(1, ""));
            }
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:8,代码来源:TeamsClientTests.cs


示例13: EnsuresNonNullLogin

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

                Assert.ThrowsAsync<ArgumentNullException>(() => client.GetMembership(1, null));
            }
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:7,代码来源:TeamsClientTests.cs


示例14: AllowsEmptyBody

            public async Task AllowsEmptyBody()
            {
                var connection = Substitute.For<IConnection>();

                var apiConnection = new ApiConnection(connection);

                var client = new TeamsClient(apiConnection);

                await client.AddMembership(1, "user");

                connection.Received().Put<Dictionary<string, string>>(
                    Arg.Is<Uri>(u => u.ToString() == "teams/1/memberships/user"),
                    Arg.Is<object>(u => u == RequestBody.Empty));
            }
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:14,代码来源:TeamsClientTests.cs


示例15: EnsureNonNullOrg

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

                Assert.ThrowsAsync<ArgumentException>(() => client.AddRepository(1, null, "Repo Name"));
            }
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:7,代码来源:TeamsClientTests.cs


示例16: EnsureNonNullRepo

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

                AssertEx.Throws<ArgumentException>(() => client.AddRepository(1, "org name", null));

            }
开发者ID:nigel-sampson,项目名称:octokit.net,代码行数:8,代码来源:TeamsClientTests.cs


示例17: RequestsTheCorrectUrl

            public void RequestsTheCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new TeamsClient(connection);
                client.GetRepositories(1);

                connection.Received().GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "teams/1/repos/"));
            }
开发者ID:kubonju,项目名称:octokit.net,代码行数:8,代码来源:TeamsClientTests.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# TechTalk类代码示例发布时间:2022-05-24
下一篇:
C# TeamCityClient类代码示例发布时间: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