extend TestGiveInventoryFolder() to check for the receipt by user 2
parent
66004a9375
commit
1543fd7fff
|
@ -66,8 +66,10 @@ namespace OpenSim.Region.Framework.Tests
|
|||
|
||||
scene.GiveInventoryFolder(user2.PrincipalID, user1.PrincipalID, folder1.ID, UUID.Zero);
|
||||
|
||||
// InventoryFolderBase receivedFolder1Template = new InventoryFolderBase(
|
||||
// InventoryFolderBase receivedFolder1 = scene.InventoryService.GetFolder
|
||||
InventoryFolderBase retrievedFolder1
|
||||
= UserInventoryHelpers.GetInventoryFolder(scene.InventoryService, user2.PrincipalID, "folder1");
|
||||
|
||||
Assert.That(retrievedFolder1, Is.Not.Null);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,8 +26,10 @@
|
|||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
|
@ -118,5 +120,24 @@ namespace OpenSim.Tests.Common
|
|||
else
|
||||
return newFolder;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the inventory folder that matches the path name. If there are multiple folders then only the first
|
||||
/// is returned.
|
||||
/// </summary>
|
||||
/// <param name="inventoryService"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <returns>null if no folder matching the path was found</returns>
|
||||
public static InventoryFolderBase GetInventoryFolder(IInventoryService inventoryService, UUID userId, string path)
|
||||
{
|
||||
List<InventoryFolderBase> folders
|
||||
= InventoryArchiveUtils.FindFolderByPath(inventoryService, userId, path);
|
||||
|
||||
if (folders.Count != 0)
|
||||
return folders[0];
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue