From f8f1e94cf88fe5894366b1b11ebc3c000078cb2a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 5 Nov 2009 19:32:24 +0000
Subject: add unit test for iar & escaping
---
OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | 24 ++++++++++++++++++++--
OpenSim/Tests/Common/TestHelper.cs | 1 +
2 files changed, 23 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Tests')
diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
index 3ca44a1..1b06a46 100644
--- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
+++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs
@@ -85,14 +85,34 @@ namespace OpenSim.Tests.Common.Setup
CommunicationsManager commsManager, string firstName, string lastName,
UUID userId, OnInventoryReceivedDelegate callback)
{
+ return CreateUserWithInventory(commsManager, firstName, lastName, "troll", userId, callback);
+ }
+
+ ///
+ /// Create a test user with a standard inventory
+ ///
+ ///
+ /// First name of user
+ /// Last name of user
+ /// Password
+ /// User ID
+ ///
+ /// Callback to invoke when inventory has been loaded. This is required because
+ /// loading may be asynchronous, even on standalone
+ ///
+ ///
+ 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;
- }
+ }
}
}
diff --git a/OpenSim/Tests/Common/TestHelper.cs b/OpenSim/Tests/Common/TestHelper.cs
index 4abf2e3..9d53063 100644
--- a/OpenSim/Tests/Common/TestHelper.cs
+++ b/OpenSim/Tests/Common/TestHelper.cs
@@ -54,6 +54,7 @@ namespace OpenSim.Tests.Common
public static void InMethod()
{
StackTrace stackTrace = new StackTrace();
+ Console.WriteLine();
Console.WriteLine("===> In Test Method : {0} <===", stackTrace.GetFrame(1).GetMethod().Name);
}
}
--
cgit v1.1