From f61b2342524023b89725e3473b8332fe6a8e71ca Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 Apr 2012 01:52:16 +0100 Subject: refactor: move common init code into SetUp() in SceneObjectSpatialTests --- .../Scenes/Tests/SceneObjectSpatialTests.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index 3509de1..69b5b1f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs @@ -44,19 +44,26 @@ namespace OpenSim.Region.Framework.Scenes.Tests [TestFixture] public class SceneObjectSpatialTests { + TestScene m_scene; + UUID m_ownerId = TestHelpers.ParseTail(0x1); + + [SetUp] + public void SetUp() + { + m_scene = SceneHelpers.SetupScene(); + } + [Test] public void TestSceneObjectGroupPosition() { TestHelpers.InMethod(); - Scene scene = SceneHelpers.SetupScene(); - UUID ownerId = TestHelpers.ParseTail(0x1); Vector3 position = new Vector3(10, 20, 30); SceneObjectGroup so - = SceneHelpers.CreateSceneObject(1, ownerId, "obj1", 0x10); + = SceneHelpers.CreateSceneObject(1, m_ownerId, "obj1", 0x10); so.AbsolutePosition = position; - scene.AddNewSceneObject(so, false); + m_scene.AddNewSceneObject(so, false); Assert.That(so.AbsolutePosition, Is.EqualTo(position)); } @@ -66,14 +73,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests { TestHelpers.InMethod(); - Scene scene = SceneHelpers.SetupScene(); - UUID ownerId = TestHelpers.ParseTail(0x1); Vector3 partPosition = new Vector3(10, 20, 30); SceneObjectGroup so - = SceneHelpers.CreateSceneObject(1, ownerId, "obj1", 0x10); + = SceneHelpers.CreateSceneObject(1, m_ownerId, "obj1", 0x10); so.AbsolutePosition = partPosition; - scene.AddNewSceneObject(so, false); + m_scene.AddNewSceneObject(so, false); Assert.That(so.RootPart.AbsolutePosition, Is.EqualTo(partPosition)); Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero)); -- cgit v1.1