public void TestUpdateUser()
{
string
username = "******" + DateTime.Now.Ticks,
newusername = "******" + DateTime.Now.Ticks;
string
firstPath = IAMUtil.MakePath("first"),
secondPath = IAMUtil.MakePath("second");
try
{
Client.CreateUser(new CreateUserRequest()
{
UserName = username, Path = firstPath
});
GetUserResponse response = Client.GetUser(new GetUserRequest()
{
UserName = username
});
Assert.AreEqual(firstPath, response.User.Path);
string id = response.User.UserId;
Client.UpdateUser(new UpdateUserRequest()
{
UserName = username, NewPath = secondPath, NewUserName = newusername
});
response = Client.GetUser(new GetUserRequest()
{
UserName = newusername
});
Assert.AreEqual(newusername, response.User.UserName);
Assert.AreEqual(secondPath, response.User.Path);
Assert.AreEqual(id, response.User.UserId);
}
finally
{
Client.DeleteUser(new DeleteUserRequest()
{
UserName = newusername
});
}
}