本文整理汇总了C#中net.openstack.Providers.Rackspace.CloudIdentityProvider.ListUsers方法的典型用法代码示例。如果您正苦于以下问题:C# CloudIdentityProvider.ListUsers方法的具体用法?C# CloudIdentityProvider.ListUsers怎么用?C# CloudIdentityProvider.ListUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.openstack.Providers.Rackspace.CloudIdentityProvider
的用法示例。
在下文中一共展示了CloudIdentityProvider.ListUsers方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ListUsers
public void ListUsers()
{
var identity = new CloudIdentity { Username = "{username}", APIKey = "{apiKey}" };
var provider = new CloudIdentityProvider(identity);
#region ListUsers
IEnumerable<User> users = provider.ListUsers(null);
foreach (var user in users)
Console.WriteLine("{0}: {1}", user.Id, user.Username);
#endregion
}
示例2: Should_List_Only_Self_When_Retrieving_List_Of_Users_With_Non_Admin_Account
public void Should_List_Only_Self_When_Retrieving_List_Of_Users_With_Non_Admin_Account()
{
IIdentityProvider serviceProvider = new CloudIdentityProvider(new RackspaceCloudIdentity { Username = _testUser.Username, Password = _newTestUserPassword });
var users = serviceProvider.ListUsers();
Assert.IsTrue(users.Count() == 1);
Assert.AreEqual(_testUser.Username, users.First().Username);
}
示例3: Should_List_Multiple_Users_When_Retrieving_List_Of_Users_With_Admin_Account
public void Should_List_Multiple_Users_When_Retrieving_List_Of_Users_With_Admin_Account()
{
IIdentityProvider serviceProvider = new CloudIdentityProvider(_testAdminIdentity);
var users = serviceProvider.ListUsers();
Assert.IsTrue(users.Any());
}
示例4: Should_List_Only_User_In_Account_When_Retrieving_List_Of_Users_With_User_Admin_Account
public void Should_List_Only_User_In_Account_When_Retrieving_List_Of_Users_With_User_Admin_Account()
{
IIdentityProvider serviceProvider = new CloudIdentityProvider(_testIdentity);
var users = serviceProvider.ListUsers();
Assert.IsTrue(users.Any());
Assert.AreEqual(_testIdentity.Username, users.First().Username);
}
示例5: TestListUsers
public void TestListUsers()
{
IIdentityProvider provider = new CloudIdentityProvider(Bootstrapper.Settings.TestIdentity);
IEnumerable<User> users = provider.ListUsers();
Assert.IsNotNull(users);
Assert.IsTrue(users.Any());
foreach (User user in users)
{
Console.WriteLine("User \"{0}\" (id: {1})", user.Username, user.Id);
if (!user.Enabled)
Console.WriteLine(" Disabled");
if (!string.IsNullOrEmpty(user.Email))
Console.WriteLine(" Email: {0}", user.Email);
if (!string.IsNullOrEmpty(user.DefaultRegion))
Console.WriteLine(" Default region: {0}", user.DefaultRegion);
}
}
示例6: CleanupUsers
public void CleanupUsers()
{
IIdentityProvider provider = new CloudIdentityProvider(Bootstrapper.Settings.TestIdentity);
IEnumerable<User> users = provider.ListUsers();
foreach (User user in users)
{
if (string.IsNullOrEmpty(user.Username))
continue;
if (!user.Username.StartsWith(TestUserPrefix, StringComparison.OrdinalIgnoreCase))
continue;
bool deleted = provider.DeleteUser(user.Id);
Assert.IsTrue(deleted);
}
}