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


C# OrganizationMembersClient.GetAll方法代码示例

本文整理汇总了C#中OrganizationMembersClient.GetAll方法的典型用法代码示例。如果您正苦于以下问题:C# OrganizationMembersClient.GetAll方法的具体用法?C# OrganizationMembersClient.GetAll怎么用?C# OrganizationMembersClient.GetAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OrganizationMembersClient的用法示例。


在下文中一共展示了OrganizationMembersClient.GetAll方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EnsureNonNullArguments

            public async Task EnsureNonNullArguments()
            {
                var orgMembers = new OrganizationMembersClient(Substitute.For<IApiConnection>());

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

示例2: EnsureNonNullArguments

            public void EnsureNonNullArguments()
            {
                var orgMembers = new OrganizationMembersClient(Substitute.For<IApiConnection>());

                AssertEx.Throws<ArgumentNullException>(async () => await orgMembers.GetAll(null));
                AssertEx.Throws<ArgumentException>(async () => await orgMembers.GetAll(""));
            }
开发者ID:rahulvramesh,项目名称:octokit.net,代码行数:7,代码来源:OrganizationMembersClientTests.cs

示例3: RequestsTheCorrectUrl

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

                orgMembersClient.GetAll("org");

                client.Received().GetAll<User>(Arg.Is<Uri>(u => u.ToString() == "orgs/org/members"), Args.ApiOptions);
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:9,代码来源:OrganizationMembersClientTests.cs

示例4: TwoFactorFilterRequestTheCorrectUrl

            public void TwoFactorFilterRequestTheCorrectUrl()
            {
                var client = Substitute.For<IApiConnection>();
                var orgMembersClient = new OrganizationMembersClient(client);

                orgMembersClient.GetAll("org", OrganizationMembersFilter.TwoFactorAuthenticationDisabled);

                client.Received().GetAll<User>(Arg.Is<Uri>(u => u.ToString() == "orgs/org/members?filter=2fa_disabled"));
            }
开发者ID:Feng2012,项目名称:octokit.net,代码行数:9,代码来源:OrganizationMembersClientTests.cs

示例5: AllFilterRequestTheCorrectUrl

            public void AllFilterRequestTheCorrectUrl()
            {
                var client = Substitute.For<IApiConnection>();
                var orgMembersClient = new OrganizationMembersClient(client);

                orgMembersClient.GetAll("org", OrganizationMembersFilter.All);

                client.Received().GetAll<User>(Arg.Is<Uri>(u => u.ToString() == "orgs/org/members?filter=all"));
            }
开发者ID:Feng2012,项目名称:octokit.net,代码行数:9,代码来源:OrganizationMembersClientTests.cs

示例6: RequestsTheCorrectUrlWithApiOptions

            public void RequestsTheCorrectUrlWithApiOptions()
            {
                var client = Substitute.For<IApiConnection>();
                var orgMembersClient = new OrganizationMembersClient(client);

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

                orgMembersClient.GetAll("org", options);

                client.Received().GetAll<User>(Arg.Is<Uri>(u => u.ToString() == "orgs/org/members"), options);
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:16,代码来源:OrganizationMembersClientTests.cs

示例7: EnsureNonNullArguments

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

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null));

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null, ApiOptions.None));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll("org", null));

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null, OrganizationMembersFilter.All));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null, OrganizationMembersFilter.All, ApiOptions.None));

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll("org", OrganizationMembersFilter.All, null));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null, OrganizationMembersFilter.All, OrganizationMembersRole.Admin));

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null, OrganizationMembersFilter.All, OrganizationMembersRole.Admin, ApiOptions.None));
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll("org", OrganizationMembersFilter.All, OrganizationMembersRole.Admin, null));

                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll(""));
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll("", ApiOptions.None));
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll("", OrganizationMembersFilter.All));
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll("", OrganizationMembersFilter.All, OrganizationMembersRole.Admin));
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll("", OrganizationMembersFilter.All, OrganizationMembersRole.Admin, ApiOptions.None));
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:24,代码来源:OrganizationMembersClientTests.cs

示例8: TwoFactorFilterPlusMemberRoleRequestTheCorrectUrlWithApiOptions

            public void TwoFactorFilterPlusMemberRoleRequestTheCorrectUrlWithApiOptions()
            {
                var client = Substitute.For<IApiConnection>();
                var orgMembersClient = new OrganizationMembersClient(client);

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

                orgMembersClient.GetAll("org", OrganizationMembersFilter.TwoFactorAuthenticationDisabled, OrganizationMembersRole.Member, options);

                client.Received().GetAll<User>(Arg.Is<Uri>(u => u.ToString() == "orgs/org/members?filter=2fa_disabled&role=member"), options);
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:16,代码来源:OrganizationMembersClientTests.cs

示例9: AllFilterPlusAdminRoleFilterRequestTheCorrectUrl

            public void AllFilterPlusAdminRoleFilterRequestTheCorrectUrl()
            {
                var client = Substitute.For<IApiConnection>();
                var orgMembersClient = new OrganizationMembersClient(client);

                orgMembersClient.GetAll("org", OrganizationMembersFilter.All, OrganizationMembersRole.Admin);

                client.Received().GetAll<User>(Arg.Is<Uri>(u => u.ToString() == "orgs/org/members?filter=all&role=admin"), Args.ApiOptions);
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:9,代码来源:OrganizationMembersClientTests.cs


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