diff options
author | Justin Clark-Casey (justincc) | 2013-02-11 22:44:25 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-02-11 22:44:25 +0000 |
commit | 8fcfd8224165908284b729935a5bf61d07545958 (patch) | |
tree | 58e424924fbc945676c19daba6ffe4bd324112bc /OpenSim | |
parent | Add section to TestJsonSetValue() to test attempted set of value where the pe... (diff) | |
download | opensim-SC-8fcfd8224165908284b729935a5bf61d07545958.zip opensim-SC-8fcfd8224165908284b729935a5bf61d07545958.tar.gz opensim-SC-8fcfd8224165908284b729935a5bf61d07545958.tar.bz2 opensim-SC-8fcfd8224165908284b729935a5bf61d07545958.tar.xz |
Extend TestJsonTestPath() for non-terminating section of path (i.e. one that does not point to a value/leaf)
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs index 2af3afc..98d8ff6 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs | |||
@@ -224,18 +224,30 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests | |||
224 | TestHelpers.InMethod(); | 224 | TestHelpers.InMethod(); |
225 | // TestHelpers.EnableLogging(); | 225 | // TestHelpers.EnableLogging(); |
226 | 226 | ||
227 | UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : 'World' }"); | 227 | UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'One' } }"); |
228 | 228 | ||
229 | int result = (int)InvokeOp("JsonTestPath", storeId, "Hello"); | 229 | { |
230 | Assert.That(result, Is.EqualTo(1)); | 230 | int result = (int)InvokeOp("JsonTestPath", storeId, "Hello.World"); |
231 | Assert.That(result, Is.EqualTo(1)); | ||
232 | } | ||
233 | |||
234 | // Test for path which does not resolve to a value. | ||
235 | { | ||
236 | int result = (int)InvokeOp("JsonTestPath", storeId, "Hello"); | ||
237 | Assert.That(result, Is.EqualTo(0)); | ||
238 | } | ||
231 | 239 | ||
232 | int result2 = (int)InvokeOp("JsonTestPath", storeId, "foo"); | 240 | { |
233 | Assert.That(result2, Is.EqualTo(0)); | 241 | int result2 = (int)InvokeOp("JsonTestPath", storeId, "foo"); |
242 | Assert.That(result2, Is.EqualTo(0)); | ||
243 | } | ||
234 | 244 | ||
235 | // Test with fake store | 245 | // Test with fake store |
236 | UUID fakeStoreId = TestHelpers.ParseTail(0x500); | 246 | { |
237 | int fakeStoreValueRemove = (int)InvokeOp("JsonTestPath", fakeStoreId, "Hello"); | 247 | UUID fakeStoreId = TestHelpers.ParseTail(0x500); |
238 | Assert.That(fakeStoreValueRemove, Is.EqualTo(0)); | 248 | int fakeStoreValueRemove = (int)InvokeOp("JsonTestPath", fakeStoreId, "Hello"); |
249 | Assert.That(fakeStoreValueRemove, Is.EqualTo(0)); | ||
250 | } | ||
239 | } | 251 | } |
240 | 252 | ||
241 | [Test] | 253 | [Test] |