extend TestDuplicateObject() to a two prim object

prebuild-update
Justin Clark-Casey (justincc) 2010-08-10 16:16:57 +01:00
parent a5dab074a0
commit 85fc2dfe3c
1 changed files with 19 additions and 10 deletions

View File

@ -48,22 +48,31 @@ namespace OpenSim.Region.Framework.Scenes.Tests
TestHelper.InMethod();
Scene scene = SceneSetupHelpers.SetupScene();
UUID ownerUuid = new UUID("00000000-0000-0000-0000-000000000010");
string objName = "obj1";
UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010");
string part1Name = "part1";
UUID part1Id = new UUID("00000000-0000-0000-0000-000000000001");
string part2Name = "part2";
UUID part2Id = new UUID("00000000-0000-0000-0000-000000000002");
SceneObjectPart part
= new SceneObjectPart(ownerUuid, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = objName, UUID = objUuid };
SceneObjectPart part1
= new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = part1Name, UUID = part1Id };
SceneObjectGroup so = new SceneObjectGroup(part1);
SceneObjectPart part2
= new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = part2Name, UUID = part2Id };
so.AddPart(part2);
scene.AddNewSceneObject(new SceneObjectGroup(part), false);
scene.AddNewSceneObject(so, false);
uint part1LocalId = part1.LocalId;
SceneObjectGroup duplicatedSo
= scene.SceneGraph.DuplicateObject(
part.LocalId, new Vector3(10, 0, 0), 0, ownerUuid, UUID.Zero, Quaternion.Identity);
part1LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity);
Assert.That(duplicatedSo.Children.Count, Is.EqualTo(1));
Assert.That(duplicatedSo.RootPart.LocalId, Is.Not.EqualTo(part.LocalId));
Assert.That(duplicatedSo.Children.Count, Is.EqualTo(2));
Assert.That(duplicatedSo.RootPart.LocalId, Is.Not.EqualTo(part1.LocalId));
//SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid);
}