diff options
author | Kunnis | 2009-08-09 02:01:21 -0500 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-16 13:35:44 -0400 |
commit | 23d478f2fa06d1dedabfb24cf6ff763b586173ce (patch) | |
tree | 072fdcfe343d84cf01b0881045fc96fb8403c324 /OpenSim/Data/Tests/BasicInventoryTest.cs | |
parent | Add copyright header. Formatting cleanup. (diff) | |
download | opensim-SC_OLD-23d478f2fa06d1dedabfb24cf6ff763b586173ce.zip opensim-SC_OLD-23d478f2fa06d1dedabfb24cf6ff763b586173ce.tar.gz opensim-SC_OLD-23d478f2fa06d1dedabfb24cf6ff763b586173ce.tar.bz2 opensim-SC_OLD-23d478f2fa06d1dedabfb24cf6ff763b586173ce.tar.xz |
Adding in Reflection-based testing, to ensure that all properties are covered.
Diffstat (limited to 'OpenSim/Data/Tests/BasicInventoryTest.cs')
-rw-r--r-- | OpenSim/Data/Tests/BasicInventoryTest.cs | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/OpenSim/Data/Tests/BasicInventoryTest.cs b/OpenSim/Data/Tests/BasicInventoryTest.cs index e13ed89..3c33bb4 100644 --- a/OpenSim/Data/Tests/BasicInventoryTest.cs +++ b/OpenSim/Data/Tests/BasicInventoryTest.cs | |||
@@ -115,16 +115,6 @@ namespace OpenSim.Data.Tests | |||
115 | Assert.That(db.getUserRootFolder(owner1), Is.Null); | 115 | Assert.That(db.getUserRootFolder(owner1), Is.Null); |
116 | } | 116 | } |
117 | 117 | ||
118 | [Test] | ||
119 | public void T999_StillNull() | ||
120 | { | ||
121 | // After all tests are run, these should still return no results | ||
122 | Assert.That(db.getInventoryFolder(zero), Is.Null); | ||
123 | Assert.That(db.getInventoryItem(zero), Is.Null); | ||
124 | Assert.That(db.getUserRootFolder(zero), Is.Null); | ||
125 | Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))"); | ||
126 | } | ||
127 | |||
128 | // 01x - folder tests | 118 | // 01x - folder tests |
129 | [Test] | 119 | [Test] |
130 | public void T010_FolderNonParent() | 120 | public void T010_FolderNonParent() |
@@ -248,7 +238,7 @@ namespace OpenSim.Data.Tests | |||
248 | } | 238 | } |
249 | 239 | ||
250 | [Test] | 240 | [Test] |
251 | public void T103UpdateItem() | 241 | public void T103_UpdateItem() |
252 | { | 242 | { |
253 | // TODO: probably shouldn't have the ability to have an | 243 | // TODO: probably shouldn't have the ability to have an |
254 | // owner of an item in a folder not owned by the user | 244 | // owner of an item in a folder not owned by the user |
@@ -265,6 +255,31 @@ namespace OpenSim.Data.Tests | |||
265 | Assert.That(i1.Owner, Is.EqualTo(owner2), "Assert.That(i1.Owner, Is.EqualTo(owner2))"); | 255 | Assert.That(i1.Owner, Is.EqualTo(owner2), "Assert.That(i1.Owner, Is.EqualTo(owner2))"); |
266 | } | 256 | } |
267 | 257 | ||
258 | [Test] | ||
259 | public void T104_RandomUpdateItem() | ||
260 | { | ||
261 | InventoryItemBase expected = db.getInventoryItem(item1); | ||
262 | ScrambleForTesting.Scramble(expected); | ||
263 | expected.ID = item1; | ||
264 | db.updateInventoryItem(expected); | ||
265 | |||
266 | InventoryItemBase actual = db.getInventoryItem(item1); | ||
267 | Assert.That(actual, Constraints.PropertyCompareConstraint(expected) | ||
268 | .IgnoreProperty(x=>x.InvType) | ||
269 | .IgnoreProperty(x=>x.Description) | ||
270 | .IgnoreProperty(x=>x.CreatorId)); | ||
271 | } | ||
272 | |||
273 | [Test] | ||
274 | public void T999_StillNull() | ||
275 | { | ||
276 | // After all tests are run, these should still return no results | ||
277 | Assert.That(db.getInventoryFolder(zero), Is.Null); | ||
278 | Assert.That(db.getInventoryItem(zero), Is.Null); | ||
279 | Assert.That(db.getUserRootFolder(zero), Is.Null); | ||
280 | Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0), "Assert.That(db.getInventoryInFolder(zero).Count, Is.EqualTo(0))"); | ||
281 | } | ||
282 | |||
268 | private InventoryItemBase NewItem(UUID id, UUID parent, UUID owner, string name, UUID asset) | 283 | private InventoryItemBase NewItem(UUID id, UUID parent, UUID owner, string name, UUID asset) |
269 | { | 284 | { |
270 | InventoryItemBase i = new InventoryItemBase(); | 285 | InventoryItemBase i = new InventoryItemBase(); |