From cc7ff3ac2ef44d46e2b8dbce336ed3c851e8080c Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 10 Sep 2008 19:14:12 +0000 Subject: added in a few more tests --- OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs | 46 +++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs index fa5193f..727174d 100644 --- a/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs +++ b/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; using OpenSim.Framework; using OpenSim.Data.SQLite; using OpenSim.Region.Environment.Scenes; @@ -64,24 +65,57 @@ namespace OpenSim.Data.SQLite.Tests Assert.AreEqual(0, objs.Count); } + // SOG round trips + // * store objects, make sure they save + // * update + [Test] - public void T010_StoreObject() + public void T010_StoreSimpleObject() { - SceneObjectGroup sog = NewSOG(); + SceneObjectGroup sog = NewSOG("object1"); + SceneObjectGroup sog2 = NewSOG("object2"); db.StoreObject(sog, region); + db.StoreObject(sog2, region); + + // This tests the ADO.NET driver + List objs = db.LoadObjects(region); + Assert.AreEqual(2, objs.Count); + + // This confirms things actually went to disk + db = new SQLiteRegionData(); + db.Initialise(connect); + List objs2 = db.LoadObjects(region); + Assert.AreEqual(2, objs2.Count); + } + + [Test] + public void T011_ObjectNames() + { List objs = db.LoadObjects(region); - Assert.AreEqual(1, objs.Count); + foreach (SceneObjectGroup sog in objs) + { + SceneObjectPart p = sog.RootPart; + Assert.That("", Text.DoesNotMatch(p.Name)); + Assert.That(p.Name, Text.Matches(p.Description)); + } + } + + [Test] + public void T010_UpdateObject() + { + } - private SceneObjectGroup NewSOG() + + private SceneObjectGroup NewSOG(string name) { SceneObjectGroup sog = new SceneObjectGroup(); SceneObjectPart sop = new SceneObjectPart(); sop.LocalId = 1; - sop.Name = ""; - sop.Description = ""; + sop.Name = name; + sop.Description = name; sop.Text = ""; sop.SitName = ""; sop.TouchName = ""; -- cgit v1.1