diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs index e91c02d..2af3afc 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs | |||
@@ -244,18 +244,33 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests | |||
244 | TestHelpers.InMethod(); | 244 | TestHelpers.InMethod(); |
245 | // TestHelpers.EnableLogging(); | 245 | // TestHelpers.EnableLogging(); |
246 | 246 | ||
247 | UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }"); | 247 | { |
248 | UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }"); | ||
248 | 249 | ||
249 | int result = (int)InvokeOp("JsonSetValue", storeId, "Fun", "Times"); | 250 | int result = (int)InvokeOp("JsonSetValue", storeId, "Fun", "Times"); |
250 | Assert.That(result, Is.EqualTo(1)); | 251 | Assert.That(result, Is.EqualTo(1)); |
251 | 252 | ||
252 | string value = (string)InvokeOp("JsonGetValue", storeId, "Fun"); | 253 | string value = (string)InvokeOp("JsonGetValue", storeId, "Fun"); |
253 | Assert.That(value, Is.EqualTo("Times")); | 254 | Assert.That(value, Is.EqualTo("Times")); |
255 | } | ||
256 | |||
257 | // Test setting to location that does not exist. This should fail. | ||
258 | { | ||
259 | UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ }"); | ||
260 | |||
261 | int result = (int)InvokeOp("JsonSetValue", storeId, "Fun.Circus", "Times"); | ||
262 | Assert.That(result, Is.EqualTo(0)); | ||
263 | |||
264 | string value = (string)InvokeOp("JsonGetValue", storeId, "Fun.Circus"); | ||
265 | Assert.That(value, Is.EqualTo("")); | ||
266 | } | ||
254 | 267 | ||
255 | // Test with fake store | 268 | // Test with fake store |
256 | UUID fakeStoreId = TestHelpers.ParseTail(0x500); | 269 | { |
257 | int fakeStoreValueSet = (int)InvokeOp("JsonSetValue", fakeStoreId, "Hello", "World"); | 270 | UUID fakeStoreId = TestHelpers.ParseTail(0x500); |
258 | Assert.That(fakeStoreValueSet, Is.EqualTo(0)); | 271 | int fakeStoreValueSet = (int)InvokeOp("JsonSetValue", fakeStoreId, "Hello", "World"); |
272 | Assert.That(fakeStoreValueSet, Is.EqualTo(0)); | ||
273 | } | ||
259 | } | 274 | } |
260 | 275 | ||
261 | /// <summary> | 276 | /// <summary> |