mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
add unit test for iar & escaping
This commit is contained in:
@@ -84,15 +84,35 @@ namespace OpenSim.Tests.Common.Setup
|
||||
public static CachedUserInfo CreateUserWithInventory(
|
||||
CommunicationsManager commsManager, string firstName, string lastName,
|
||||
UUID userId, OnInventoryReceivedDelegate callback)
|
||||
{
|
||||
return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a test user with a standard inventory
|
||||
/// </summary>
|
||||
/// <param name="commsManager"></param>
|
||||
/// <param name="firstName">First name of user</param>
|
||||
/// <param name="lastName">Last name of user</param>
|
||||
/// <param name="password">Password</param>
|
||||
/// <param name="userId">User ID</param>
|
||||
/// <param name="callback">
|
||||
/// Callback to invoke when inventory has been loaded. This is required because
|
||||
/// loading may be asynchronous, even on standalone
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
public static CachedUserInfo CreateUserWithInventory(
|
||||
CommunicationsManager commsManager, string firstName, string lastName, string password,
|
||||
UUID userId, OnInventoryReceivedDelegate callback)
|
||||
{
|
||||
LocalUserServices lus = (LocalUserServices)commsManager.UserService;
|
||||
lus.AddUser(firstName, lastName, "troll", "bill@bailey.com", 1000, 1000, userId);
|
||||
lus.AddUser(firstName, lastName, password, "bill@bailey.com", 1000, 1000, userId);
|
||||
|
||||
CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId);
|
||||
userInfo.OnInventoryReceived += callback;
|
||||
userInfo.FetchInventory();
|
||||
|
||||
return userInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user