diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index 8a103d7081..bb6e540896 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs @@ -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); }