当前位置: 首页>>代码示例>>C#>>正文


C# TeamsClient类代码示例

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


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


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