From 23d478f2fa06d1dedabfb24cf6ff763b586173ce Mon Sep 17 00:00:00 2001 From: Kunnis Date: Sun, 9 Aug 2009 02:01:21 -0500 Subject: Adding in Reflection-based testing, to ensure that all properties are covered. --- OpenSim/Data/Tests/BasicRegionTest.cs | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'OpenSim/Data/Tests/BasicRegionTest.cs') diff --git a/OpenSim/Data/Tests/BasicRegionTest.cs b/OpenSim/Data/Tests/BasicRegionTest.cs index 836da78..a746ef0 100644 --- a/OpenSim/Data/Tests/BasicRegionTest.cs +++ b/OpenSim/Data/Tests/BasicRegionTest.cs @@ -532,6 +532,53 @@ namespace OpenSim.Data.Tests Assert.That(cursop.Acceleration,Is.EqualTo(parts[i].Acceleration), "Assert.That(cursop.Acceleration,Is.EqualTo(parts[i].Acceleration))"); } } + + [Test] + public void T016_RandomSogWithSceneParts() + { + UUID tmpSog = UUID.Random(); + UUID tmp1 = UUID.Random(); + UUID tmp2 = UUID.Random(); + UUID tmp3 = UUID.Random(); + UUID newregion = UUID.Random(); + SceneObjectPart p1 = new SceneObjectPart(); + SceneObjectPart p2 = new SceneObjectPart(); + SceneObjectPart p3 = new SceneObjectPart(); + p1.Shape = PrimitiveBaseShape.Default; + p2.Shape = PrimitiveBaseShape.Default; + p3.Shape = PrimitiveBaseShape.Default; + ScrambleForTesting.Scramble(p1); + ScrambleForTesting.Scramble(p2); + ScrambleForTesting.Scramble(p3); + p1.UUID = tmp1; + p2.UUID = tmp2; + p3.UUID = tmp3; + SceneObjectGroup sog = NewSOG("Sop 0", tmpSog, newregion); + ScrambleForTesting.Scramble(sog); + sog.UUID = tmpSog; + sog.AddPart(p1); + sog.AddPart(p2); + sog.AddPart(p3); + + SceneObjectPart[] parts = sog.GetParts(); + Assert.That(parts.Length, Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))"); + + db.StoreObject(sog, newregion); + List sogs = db.LoadObjects(newregion); + Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))"); + SceneObjectGroup newsog = sogs[0]; + + SceneObjectPart[] newparts = newsog.GetParts(); + Assert.That(newparts.Length, Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))"); + + Assert.That(newsog, Constraints.PropertyCompareConstraint(sog) + .IgnoreProperty(x=>x.LocalId) + .IgnoreProperty(x=>x.HasGroupChanged) + .IgnoreProperty(x=>x.IsSelected) + .IgnoreProperty(x=>x.RegionHandle) + .IgnoreProperty(x=>x.Scene) + .IgnoreProperty(x=>x.RootPart.InventorySerial)); + } [Test] public void T020_PrimInventoryEmpty() -- cgit v1.1