diff options
author | Justin Clark-Casey (justincc) | 2012-04-14 01:52:16 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-04-14 01:52:16 +0100 |
commit | f61b2342524023b89725e3473b8332fe6a8e71ca (patch) | |
tree | e35e0a449ed96dd96ea10538bdee33004b08482c /OpenSim/Region | |
parent | refactor: put SOG position test in a separate TestSceneObjectGroupPosition() (diff) | |
download | opensim-SC_OLD-f61b2342524023b89725e3473b8332fe6a8e71ca.zip opensim-SC_OLD-f61b2342524023b89725e3473b8332fe6a8e71ca.tar.gz opensim-SC_OLD-f61b2342524023b89725e3473b8332fe6a8e71ca.tar.bz2 opensim-SC_OLD-f61b2342524023b89725e3473b8332fe6a8e71ca.tar.xz |
refactor: move common init code into SetUp() in SceneObjectSpatialTests
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs | 21 |
1 files 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 | |||
44 | [TestFixture] | 44 | [TestFixture] |
45 | public class SceneObjectSpatialTests | 45 | public class SceneObjectSpatialTests |
46 | { | 46 | { |
47 | TestScene m_scene; | ||
48 | UUID m_ownerId = TestHelpers.ParseTail(0x1); | ||
49 | |||
50 | [SetUp] | ||
51 | public void SetUp() | ||
52 | { | ||
53 | m_scene = SceneHelpers.SetupScene(); | ||
54 | } | ||
55 | |||
47 | [Test] | 56 | [Test] |
48 | public void TestSceneObjectGroupPosition() | 57 | public void TestSceneObjectGroupPosition() |
49 | { | 58 | { |
50 | TestHelpers.InMethod(); | 59 | TestHelpers.InMethod(); |
51 | 60 | ||
52 | Scene scene = SceneHelpers.SetupScene(); | ||
53 | UUID ownerId = TestHelpers.ParseTail(0x1); | ||
54 | Vector3 position = new Vector3(10, 20, 30); | 61 | Vector3 position = new Vector3(10, 20, 30); |
55 | 62 | ||
56 | SceneObjectGroup so | 63 | SceneObjectGroup so |
57 | = SceneHelpers.CreateSceneObject(1, ownerId, "obj1", 0x10); | 64 | = SceneHelpers.CreateSceneObject(1, m_ownerId, "obj1", 0x10); |
58 | so.AbsolutePosition = position; | 65 | so.AbsolutePosition = position; |
59 | scene.AddNewSceneObject(so, false); | 66 | m_scene.AddNewSceneObject(so, false); |
60 | 67 | ||
61 | Assert.That(so.AbsolutePosition, Is.EqualTo(position)); | 68 | Assert.That(so.AbsolutePosition, Is.EqualTo(position)); |
62 | } | 69 | } |
@@ -66,14 +73,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
66 | { | 73 | { |
67 | TestHelpers.InMethod(); | 74 | TestHelpers.InMethod(); |
68 | 75 | ||
69 | Scene scene = SceneHelpers.SetupScene(); | ||
70 | UUID ownerId = TestHelpers.ParseTail(0x1); | ||
71 | Vector3 partPosition = new Vector3(10, 20, 30); | 76 | Vector3 partPosition = new Vector3(10, 20, 30); |
72 | 77 | ||
73 | SceneObjectGroup so | 78 | SceneObjectGroup so |
74 | = SceneHelpers.CreateSceneObject(1, ownerId, "obj1", 0x10); | 79 | = SceneHelpers.CreateSceneObject(1, m_ownerId, "obj1", 0x10); |
75 | so.AbsolutePosition = partPosition; | 80 | so.AbsolutePosition = partPosition; |
76 | scene.AddNewSceneObject(so, false); | 81 | m_scene.AddNewSceneObject(so, false); |
77 | 82 | ||
78 | Assert.That(so.RootPart.AbsolutePosition, Is.EqualTo(partPosition)); | 83 | Assert.That(so.RootPart.AbsolutePosition, Is.EqualTo(partPosition)); |
79 | Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero)); | 84 | Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero)); |