aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorSean Dague2008-09-11 20:52:35 +0000
committerSean Dague2008-09-11 20:52:35 +0000
commit7d61559058128f0b6b37ae897aa9d739cf7d1b73 (patch)
tree577cca44e58aa35ac7b89c78f7e66cb9fa7f395b /OpenSim
parentadd some folder create and list tests (diff)
downloadopensim-SC_OLD-7d61559058128f0b6b37ae897aa9d739cf7d1b73.zip
opensim-SC_OLD-7d61559058128f0b6b37ae897aa9d739cf7d1b73.tar.gz
opensim-SC_OLD-7d61559058128f0b6b37ae897aa9d739cf7d1b73.tar.bz2
opensim-SC_OLD-7d61559058128f0b6b37ae897aa9d739cf7d1b73.tar.xz
more inventory folder tests
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs65
1 files changed, 55 insertions, 10 deletions
diff --git a/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs
index 2865f44..4bc1b9a 100644
--- a/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs
+++ b/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs
@@ -124,22 +124,67 @@ namespace OpenSim.Data.SQLite.Tests
124 InventoryFolderBase f2 = NewFolder(uuid3, uuid1, owner1, name3); 124 InventoryFolderBase f2 = NewFolder(uuid3, uuid1, owner1, name3);
125 db.addInventoryFolder(f2); 125 db.addInventoryFolder(f2);
126 126
127 List<InventoryFolderBase> flist = db.getInventoryFolders(zero); 127 Assert.That(db.getInventoryFolders(zero).Count, Is.EqualTo(1));
128 Assert.That(flist.Count, Is.EqualTo(1));
129 128
130 flist = db.getInventoryFolders(uuid1); 129 Assert.That(db.getInventoryFolders(uuid1).Count, Is.EqualTo(2));
131 Assert.That(flist.Count, Is.EqualTo(2));
132 130
133 flist = db.getInventoryFolders(uuid2); 131 Assert.That(db.getInventoryFolders(uuid2).Count, Is.EqualTo(0));
134 Assert.That(flist.Count, Is.EqualTo(0));
135 132
136 flist = db.getInventoryFolders(uuid3); 133 Assert.That(db.getInventoryFolders(uuid3).Count, Is.EqualTo(0));
137 Assert.That(flist.Count, Is.EqualTo(0));
138 134
139 flist = db.getInventoryFolders(UUID.Random()); 135 Assert.That(db.getInventoryFolders(UUID.Random()).Count, Is.EqualTo(0));
140 Assert.That(flist.Count, Is.EqualTo(0)); 136
137 }
138
139 [Test]
140 public void T013_FolderHierarchy()
141 {
142 Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0));
143
144 Assert.That(db.getFolderHierarchy(uuid1).Count, Is.EqualTo(2));
145
146 Assert.That(db.getFolderHierarchy(uuid2).Count, Is.EqualTo(0));
147
148 Assert.That(db.getFolderHierarchy(uuid3).Count, Is.EqualTo(0));
149
150 Assert.That(db.getFolderHierarchy(UUID.Random()).Count, Is.EqualTo(0));
141 } 151 }
142 152
153
154 [Test]
155 public void T014_MoveFolder()
156 {
157 InventoryFolderBase f2 = db.getInventoryFolder(uuid2);
158 f2.ParentID = uuid3;
159 db.moveInventoryFolder(f2);
160
161 Assert.That(db.getInventoryFolders(zero).Count, Is.EqualTo(1));
162
163 Assert.That(db.getInventoryFolders(uuid1).Count, Is.EqualTo(1));
164
165 Assert.That(db.getInventoryFolders(uuid2).Count, Is.EqualTo(0));
166
167 Assert.That(db.getInventoryFolders(uuid3).Count, Is.EqualTo(1));
168
169 Assert.That(db.getInventoryFolders(UUID.Random()).Count, Is.EqualTo(0));
170 }
171
172 [Test]
173 public void T015_FolderHierarchy()
174 {
175 Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0));
176
177 Assert.That(db.getFolderHierarchy(uuid1).Count, Is.EqualTo(2));
178
179 Assert.That(db.getFolderHierarchy(uuid2).Count, Is.EqualTo(0));
180
181 Assert.That(db.getFolderHierarchy(uuid3).Count, Is.EqualTo(1));
182
183 Assert.That(db.getFolderHierarchy(UUID.Random()).Count, Is.EqualTo(0));
184 }
185
186
187
143 private InventoryFolderBase NewFolder(UUID id, UUID parent, UUID owner, string name) 188 private InventoryFolderBase NewFolder(UUID id, UUID parent, UUID owner, string name)
144 { 189 {
145 InventoryFolderBase f = new InventoryFolderBase(); 190 InventoryFolderBase f = new InventoryFolderBase();