aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Tests/BasicInventoryTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/Tests/BasicInventoryTest.cs')
-rw-r--r--OpenSim/Data/Tests/BasicInventoryTest.cs82
1 files changed, 41 insertions, 41 deletions
diff --git a/OpenSim/Data/Tests/BasicInventoryTest.cs b/OpenSim/Data/Tests/BasicInventoryTest.cs
index eed6cab..c614577 100644
--- a/OpenSim/Data/Tests/BasicInventoryTest.cs
+++ b/OpenSim/Data/Tests/BasicInventoryTest.cs
@@ -122,7 +122,7 @@ namespace OpenSim.Data.Tests
122 Assert.That(db.getInventoryFolder(zero), Is.Null); 122 Assert.That(db.getInventoryFolder(zero), Is.Null);
123 Assert.That(db.getInventoryItem(zero), Is.Null); 123 Assert.That(db.getInventoryItem(zero), Is.Null);
124 Assert.That(db.getUserRootFolder(zero), Is.Null); 124 Assert.That(db.getUserRootFolder(zero), Is.Null);
125 Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0)); 125 Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))");
126 } 126 }
127 127
128 // 01x - folder tests 128 // 01x - folder tests
@@ -144,14 +144,14 @@ namespace OpenSim.Data.Tests
144 // db.updateInventoryFolder(f1); 144 // db.updateInventoryFolder(f1);
145 // InventoryFolderBase f1a = db.getUserRootFolder(owner1); 145 // InventoryFolderBase f1a = db.getUserRootFolder(owner1);
146 // Assert.That(uuid1, Is.EqualTo(f1a.ID)) 146 // Assert.That(uuid1, Is.EqualTo(f1a.ID))
147 // Assert.That(name1, Text.Matches(f1a.Name)); 147 // Assert.That(name1, Text.Matches(f1a.Name), "Assert.That(name1, Text.Matches(f1a.Name))");
148 // Assert.That(db.getUserRootFolder(owner1), Is.Null); 148 // Assert.That(db.getUserRootFolder(owner1), Is.Null);
149 149
150 // succeed with true 150 // succeed with true
151 db.addInventoryFolder(f1); 151 db.addInventoryFolder(f1);
152 InventoryFolderBase f1a = db.getUserRootFolder(owner1); 152 InventoryFolderBase f1a = db.getUserRootFolder(owner1);
153 Assert.That(folder1, Is.EqualTo(f1a.ID)); 153 Assert.That(folder1, Is.EqualTo(f1a.ID), "Assert.That(folder1, Is.EqualTo(f1a.ID))");
154 Assert.That(name1, Text.Matches(f1a.Name)); 154 Assert.That(name1, Text.Matches(f1a.Name), "Assert.That(name1, Text.Matches(f1a.Name))");
155 } 155 }
156 156
157 // we now have the following tree 157 // we now have the following tree
@@ -165,22 +165,22 @@ namespace OpenSim.Data.Tests
165 InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3); 165 InventoryFolderBase f2 = NewFolder(folder3, folder1, owner1, name3);
166 db.addInventoryFolder(f2); 166 db.addInventoryFolder(f2);
167 167
168 Assert.That(db.getInventoryFolders(zero).Count, Is.EqualTo(1)); 168 Assert.That(db.getInventoryFolders(zero).Count, Is.EqualTo(1), "Assert.That(db.getInventoryFolders(zero).Count, Is.EqualTo(1))");
169 Assert.That(db.getInventoryFolders(folder1).Count, Is.EqualTo(2)); 169 Assert.That(db.getInventoryFolders(folder1).Count, Is.EqualTo(2), "Assert.That(db.getInventoryFolders(folder1).Count, Is.EqualTo(2))");
170 Assert.That(db.getInventoryFolders(folder2).Count, Is.EqualTo(0)); 170 Assert.That(db.getInventoryFolders(folder2).Count, Is.EqualTo(0), "Assert.That(db.getInventoryFolders(folder2).Count, Is.EqualTo(0))");
171 Assert.That(db.getInventoryFolders(folder3).Count, Is.EqualTo(0)); 171 Assert.That(db.getInventoryFolders(folder3).Count, Is.EqualTo(0), "Assert.That(db.getInventoryFolders(folder3).Count, Is.EqualTo(0))");
172 Assert.That(db.getInventoryFolders(UUID.Random()).Count, Is.EqualTo(0)); 172 Assert.That(db.getInventoryFolders(UUID.Random()).Count, Is.EqualTo(0), "Assert.That(db.getInventoryFolders(UUID.Random()).Count, Is.EqualTo(0))");
173 173
174 } 174 }
175 175
176 [Test] 176 [Test]
177 public void T013_FolderHierarchy() 177 public void T013_FolderHierarchy()
178 { 178 {
179 Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0)); 179 Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
180 Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2)); 180 Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))");
181 Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0)); 181 Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))");
182 Assert.That(db.getFolderHierarchy(folder3).Count, Is.EqualTo(0)); 182 Assert.That(db.getFolderHierarchy(folder3).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder3).Count, Is.EqualTo(0))");
183 Assert.That(db.getFolderHierarchy(UUID.Random()).Count, Is.EqualTo(0)); 183 Assert.That(db.getFolderHierarchy(UUID.Random()).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(UUID.Random()).Count, Is.EqualTo(0))");
184 } 184 }
185 185
186 186
@@ -191,31 +191,31 @@ namespace OpenSim.Data.Tests
191 f2.ParentID = folder3; 191 f2.ParentID = folder3;
192 db.moveInventoryFolder(f2); 192 db.moveInventoryFolder(f2);
193 193
194 Assert.That(db.getInventoryFolders(zero).Count, Is.EqualTo(1)); 194 Assert.That(db.getInventoryFolders(zero).Count, Is.EqualTo(1), "Assert.That(db.getInventoryFolders(zero).Count, Is.EqualTo(1))");
195 Assert.That(db.getInventoryFolders(folder1).Count, Is.EqualTo(1)); 195 Assert.That(db.getInventoryFolders(folder1).Count, Is.EqualTo(1), "Assert.That(db.getInventoryFolders(folder1).Count, Is.EqualTo(1))");
196 Assert.That(db.getInventoryFolders(folder2).Count, Is.EqualTo(0)); 196 Assert.That(db.getInventoryFolders(folder2).Count, Is.EqualTo(0), "Assert.That(db.getInventoryFolders(folder2).Count, Is.EqualTo(0))");
197 Assert.That(db.getInventoryFolders(folder3).Count, Is.EqualTo(1)); 197 Assert.That(db.getInventoryFolders(folder3).Count, Is.EqualTo(1), "Assert.That(db.getInventoryFolders(folder3).Count, Is.EqualTo(1))");
198 Assert.That(db.getInventoryFolders(UUID.Random()).Count, Is.EqualTo(0)); 198 Assert.That(db.getInventoryFolders(UUID.Random()).Count, Is.EqualTo(0), "Assert.That(db.getInventoryFolders(UUID.Random()).Count, Is.EqualTo(0))");
199 } 199 }
200 200
201 [Test] 201 [Test]
202 public void T015_FolderHierarchy() 202 public void T015_FolderHierarchy()
203 { 203 {
204 Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0)); 204 Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(zero).Count, Is.EqualTo(0))");
205 Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2)); 205 Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2), "Assert.That(db.getFolderHierarchy(folder1).Count, Is.EqualTo(2))");
206 Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0)); 206 Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(folder2).Count, Is.EqualTo(0))");
207 Assert.That(db.getFolderHierarchy(folder3).Count, Is.EqualTo(1)); 207 Assert.That(db.getFolderHierarchy(folder3).Count, Is.EqualTo(1), "Assert.That(db.getFolderHierarchy(folder3).Count, Is.EqualTo(1))");
208 Assert.That(db.getFolderHierarchy(UUID.Random()).Count, Is.EqualTo(0)); 208 Assert.That(db.getFolderHierarchy(UUID.Random()).Count, Is.EqualTo(0), "Assert.That(db.getFolderHierarchy(UUID.Random()).Count, Is.EqualTo(0))");
209 } 209 }
210 210
211 // Item tests 211 // Item tests
212 [Test] 212 [Test]
213 public void T100_NoItems() 213 public void T100_NoItems()
214 { 214 {
215 Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0)); 215 Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))");
216 Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0)); 216 Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder1).Count, Is.EqualTo(0))");
217 Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0)); 217 Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder2).Count, Is.EqualTo(0))");
218 Assert.That(db.getInventoryInFolder(folder3).Count, Is.EqualTo(0)); 218 Assert.That(db.getInventoryInFolder(folder3).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(folder3).Count, Is.EqualTo(0))");
219 } 219 }
220 220
221 // TODO: Feeding a bad inventory item down the data path will 221 // TODO: Feeding a bad inventory item down the data path will
@@ -227,7 +227,7 @@ namespace OpenSim.Data.Tests
227 db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1)); 227 db.addInventoryItem(NewItem(item1, folder3, owner1, iname1, asset1));
228 db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2)); 228 db.addInventoryItem(NewItem(item2, folder3, owner1, iname2, asset2));
229 db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3)); 229 db.addInventoryItem(NewItem(item3, folder3, owner1, iname3, asset3));
230 Assert.That(db.getInventoryInFolder(folder3).Count, Is.EqualTo(3)); 230 Assert.That(db.getInventoryInFolder(folder3).Count, Is.EqualTo(3), "Assert.That(db.getInventoryInFolder(folder3).Count, Is.EqualTo(3))");
231 } 231 }
232 232
233 [Test] 233 [Test]
@@ -236,15 +236,15 @@ namespace OpenSim.Data.Tests
236 InventoryItemBase i1 = db.getInventoryItem(item1); 236 InventoryItemBase i1 = db.getInventoryItem(item1);
237 InventoryItemBase i2 = db.getInventoryItem(item2); 237 InventoryItemBase i2 = db.getInventoryItem(item2);
238 InventoryItemBase i3 = db.getInventoryItem(item3); 238 InventoryItemBase i3 = db.getInventoryItem(item3);
239 Assert.That(i1.Name, Is.EqualTo(iname1)); 239 Assert.That(i1.Name, Is.EqualTo(iname1), "Assert.That(i1.Name, Is.EqualTo(iname1))");
240 Assert.That(i2.Name, Is.EqualTo(iname2)); 240 Assert.That(i2.Name, Is.EqualTo(iname2), "Assert.That(i2.Name, Is.EqualTo(iname2))");
241 Assert.That(i3.Name, Is.EqualTo(iname3)); 241 Assert.That(i3.Name, Is.EqualTo(iname3), "Assert.That(i3.Name, Is.EqualTo(iname3))");
242 Assert.That(i1.Owner, Is.EqualTo(owner1)); 242 Assert.That(i1.Owner, Is.EqualTo(owner1), "Assert.That(i1.Owner, Is.EqualTo(owner1))");
243 Assert.That(i2.Owner, Is.EqualTo(owner1)); 243 Assert.That(i2.Owner, Is.EqualTo(owner1), "Assert.That(i2.Owner, Is.EqualTo(owner1))");
244 Assert.That(i3.Owner, Is.EqualTo(owner1)); 244 Assert.That(i3.Owner, Is.EqualTo(owner1), "Assert.That(i3.Owner, Is.EqualTo(owner1))");
245 Assert.That(i1.AssetID, Is.EqualTo(asset1)); 245 Assert.That(i1.AssetID, Is.EqualTo(asset1), "Assert.That(i1.AssetID, Is.EqualTo(asset1))");
246 Assert.That(i2.AssetID, Is.EqualTo(asset2)); 246 Assert.That(i2.AssetID, Is.EqualTo(asset2), "Assert.That(i2.AssetID, Is.EqualTo(asset2))");
247 Assert.That(i3.AssetID, Is.EqualTo(asset3)); 247 Assert.That(i3.AssetID, Is.EqualTo(asset3), "Assert.That(i3.AssetID, Is.EqualTo(asset3))");
248 } 248 }
249 249
250 [Test] 250 [Test]
@@ -260,9 +260,9 @@ namespace OpenSim.Data.Tests
260 db.updateInventoryItem(i1); 260 db.updateInventoryItem(i1);
261 261
262 i1 = db.getInventoryItem(item1); 262 i1 = db.getInventoryItem(item1);
263 Assert.That(i1.Name, Is.EqualTo(niname1)); 263 Assert.That(i1.Name, Is.EqualTo(niname1), "Assert.That(i1.Name, Is.EqualTo(niname1))");
264 Assert.That(i1.Description, Is.EqualTo(niname1)); 264 Assert.That(i1.Description, Is.EqualTo(niname1), "Assert.That(i1.Description, Is.EqualTo(niname1))");
265 Assert.That(i1.Owner, Is.EqualTo(owner2)); 265 Assert.That(i1.Owner, Is.EqualTo(owner2), "Assert.That(i1.Owner, Is.EqualTo(owner2))");
266 } 266 }
267 267
268 private InventoryItemBase NewItem(UUID id, UUID parent, UUID owner, string name, UUID asset) 268 private InventoryItemBase NewItem(UUID id, UUID parent, UUID owner, string name, UUID asset)