Shuffle some code around
parent
3c43cdbbcc
commit
9c82ff7673
|
@ -286,6 +286,26 @@ namespace OpenSim.Tests.Permissions
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DeleteObjectsFolders()
|
||||||
|
{
|
||||||
|
// Delete everything in A2 and A3's Objects folders, so we can restart
|
||||||
|
for (int i = 1; i < 3; i++)
|
||||||
|
{
|
||||||
|
InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[i].UUID, "Objects");
|
||||||
|
Assert.That(objsFolder, Is.Not.Null);
|
||||||
|
|
||||||
|
List<InventoryItemBase> items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID);
|
||||||
|
List<UUID> ids = new List<UUID>();
|
||||||
|
foreach (InventoryItemBase it in items)
|
||||||
|
ids.Add(it.ID);
|
||||||
|
|
||||||
|
Common.TheScene.InventoryService.DeleteItems(Common.TheAvatars[i].UUID, ids);
|
||||||
|
items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID);
|
||||||
|
Assert.That(items.Count, Is.EqualTo(0), "A" + (i + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public string IdStr(InventoryItemBase item)
|
public string IdStr(InventoryItemBase item)
|
||||||
{
|
{
|
||||||
return item.Owner.ToString().Substring(34) + " : " + item.Name;
|
return item.Owner.ToString().Substring(34) + " : " + item.Name;
|
||||||
|
|
|
@ -44,6 +44,7 @@ namespace OpenSim.Tests.Permissions
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp()
|
public void SetUp()
|
||||||
{
|
{
|
||||||
|
Common.TheInstance.DeleteObjectsFolders();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -46,21 +46,7 @@ namespace OpenSim.Tests.Permissions
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp()
|
public void SetUp()
|
||||||
{
|
{
|
||||||
// Delete everything in A2 and A3's Objects folders from previous tests
|
Common.TheInstance.DeleteObjectsFolders();
|
||||||
for (int i = 1; i < 3; i++)
|
|
||||||
{
|
|
||||||
InventoryFolderBase objsFolder = UserInventoryHelpers.GetInventoryFolder(Common.TheScene.InventoryService, Common.TheAvatars[i].UUID, "Objects");
|
|
||||||
Assert.That(objsFolder, Is.Not.Null);
|
|
||||||
|
|
||||||
List<InventoryItemBase> items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID);
|
|
||||||
List<UUID> ids = new List<UUID>();
|
|
||||||
foreach (InventoryItemBase it in items)
|
|
||||||
ids.Add(it.ID);
|
|
||||||
|
|
||||||
Common.TheScene.InventoryService.DeleteItems(Common.TheAvatars[i].UUID, ids);
|
|
||||||
items = Common.TheScene.InventoryService.GetFolderItems(Common.TheAvatars[i].UUID, objsFolder.ID);
|
|
||||||
Assert.That(items.Count, Is.EqualTo(0), "A" + (i+1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue