aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite
diff options
context:
space:
mode:
authorSean Dague2008-09-11 18:49:10 +0000
committerSean Dague2008-09-11 18:49:10 +0000
commit380af0b93998cbb22e3737c6fd0da3bd97626c0a (patch)
treebcef9ceca4fed5996b28b83bf22ae1858617f62d /OpenSim/Data/SQLite
parent* This updates the OGP module to support both the revision 2 and revision 3 o... (diff)
downloadopensim-SC-380af0b93998cbb22e3737c6fd0da3bd97626c0a.zip
opensim-SC-380af0b93998cbb22e3737c6fd0da3bd97626c0a.tar.gz
opensim-SC-380af0b93998cbb22e3737c6fd0da3bd97626c0a.tar.bz2
opensim-SC-380af0b93998cbb22e3737c6fd0da3bd97626c0a.tar.xz
added simple add / exists folder check
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r--OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs
index 21a0093..9398971 100644
--- a/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs
+++ b/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs
@@ -42,9 +42,16 @@ namespace OpenSim.Data.SQLite.Tests
42 public string file = "inventorytest.db"; 42 public string file = "inventorytest.db";
43 public string connect; 43 public string connect;
44 public SQLiteInventoryStore db; 44 public SQLiteInventoryStore db;
45 public UUID zero = UUID.Zero;
45 public UUID uuid1; 46 public UUID uuid1;
46 public UUID uuid2; 47 public UUID uuid2;
47 public UUID uuid3; 48 public UUID uuid3;
49 public UUID owner1;
50 public UUID owner2;
51 public UUID owner3;
52 public string name1;
53 public string name2;
54 public string name3;
48 55
49 56
50 [TestFixtureSetUp] 57 [TestFixtureSetUp]
@@ -56,6 +63,10 @@ namespace OpenSim.Data.SQLite.Tests
56 uuid1 = UUID.Random(); 63 uuid1 = UUID.Random();
57 uuid2 = UUID.Random(); 64 uuid2 = UUID.Random();
58 uuid3 = UUID.Random(); 65 uuid3 = UUID.Random();
66 owner1 = UUID.Random();
67 owner2 = UUID.Random();
68 owner3 = UUID.Random();
69 name1 = "Root Folder for " + owner1.ToString();
59 } 70 }
60 71
61 [TestFixtureTearDown] 72 [TestFixtureTearDown]
@@ -68,6 +79,36 @@ namespace OpenSim.Data.SQLite.Tests
68 public void T001_LoadEmpty() 79 public void T001_LoadEmpty()
69 { 80 {
70 Assert.That(db.getInventoryItem(uuid1), Is.Null); 81 Assert.That(db.getInventoryItem(uuid1), Is.Null);
82 Assert.That(db.getUserRootFolder(owner1), Is.Null);
83 }
84
85 // 01x - folder tests
86 [Test]
87 public void T010_FolderCreate()
88 {
89 InventoryFolderBase f1 = NewFolder(uuid1, zero, owner1, name1);
90 // TODO: this is probably wrong behavior, but is what we have
91 // db.updateInventoryFolder(f1);
92 // InventoryFolderBase f1a = db.getUserRootFolder(owner1);
93 // Assert.That(uuid1, Is.EqualTo(f1a.ID))
94 // Assert.That(name1, Text.Matches(f1a.Name));
95 // Assert.That(db.getUserRootFolder(owner1), Is.Null);
96
97 // succeed with true
98 db.addInventoryFolder(f1);
99 InventoryFolderBase f1a = db.getUserRootFolder(owner1);
100 Assert.That(uuid1, Is.EqualTo(f1a.ID));
101 Assert.That(name1, Text.Matches(f1a.Name));
102 }
103
104 private InventoryFolderBase NewFolder(UUID id, UUID parent, UUID owner, string name)
105 {
106 InventoryFolderBase f = new InventoryFolderBase();
107 f.ID = id;
108 f.ParentID = parent;
109 f.Owner = owner;
110 f.Name = name;
111 return f;
71 } 112 }
72 } 113 }
73} \ No newline at end of file 114} \ No newline at end of file