本文整理汇总了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(""));
}
示例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(""));
}
示例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);
}
示例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"));
}
示例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"));
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}