extend test to check that there is one attachment and that it has the right name

bulletsim
Justin Clark-Casey (justincc) 2011-08-17 00:42:58 +01:00
parent 696bd44833
commit bd5d35ee32
1 changed files with 6 additions and 1 deletions

View File

@ -122,11 +122,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
UUID userId = TestHelpers.ParseTail(0x1); UUID userId = TestHelpers.ParseTail(0x1);
UUID attItemId = TestHelpers.ParseTail(0x2); UUID attItemId = TestHelpers.ParseTail(0x2);
UUID attAssetId = TestHelpers.ParseTail(0x3); UUID attAssetId = TestHelpers.ParseTail(0x3);
string attName = "att";
UserAccountHelpers.CreateUserWithInventory(scene, userId); UserAccountHelpers.CreateUserWithInventory(scene, userId);
InventoryItemBase attItem InventoryItemBase attItem
= UserInventoryHelpers.CreateInventoryItem( = UserInventoryHelpers.CreateInventoryItem(
scene, "att", attItemId, attAssetId, userId, InventoryType.Object); scene, attName, attItemId, attAssetId, userId, InventoryType.Object);
AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId); AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId);
acd.Appearance = new AvatarAppearance(); acd.Appearance = new AvatarAppearance();
@ -134,6 +135,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
ScenePresence presence = SceneHelpers.AddScenePresence(scene, acd); ScenePresence presence = SceneHelpers.AddScenePresence(scene, acd);
Assert.That(presence.HasAttachments(), Is.True); Assert.That(presence.HasAttachments(), Is.True);
List<SceneObjectGroup> attachments = presence.Attachments;
Assert.That(attachments.Count, Is.EqualTo(1));
Assert.That(attachments[0].Name, Is.EqualTo(attName));
} }
// I'm commenting this test because scene setup NEEDS InventoryService to // I'm commenting this test because scene setup NEEDS InventoryService to