diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs index de42e74..ddbfa45 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs | |||
@@ -180,6 +180,39 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests | |||
180 | } | 180 | } |
181 | } | 181 | } |
182 | 182 | ||
183 | [Test] | ||
184 | public void TestJsonGetValueJson() | ||
185 | { | ||
186 | TestHelpers.InMethod(); | ||
187 | // TestHelpers.EnableLogging(); | ||
188 | |||
189 | UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'Two' } }"); | ||
190 | |||
191 | { | ||
192 | string value = (string)InvokeOp("JsonGetValueJson", storeId, "Hello.World"); | ||
193 | Assert.That(value, Is.EqualTo("'Two'")); | ||
194 | } | ||
195 | |||
196 | // Test get of path section instead of leaf | ||
197 | { | ||
198 | string value = (string)InvokeOp("JsonGetValueJson", storeId, "Hello"); | ||
199 | Assert.That(value, Is.EqualTo("{\"World\":\"Two\"}")); | ||
200 | } | ||
201 | |||
202 | // Test get of non-existing value | ||
203 | { | ||
204 | string fakeValueGet = (string)InvokeOp("JsonGetValueJson", storeId, "foo"); | ||
205 | Assert.That(fakeValueGet, Is.EqualTo("")); | ||
206 | } | ||
207 | |||
208 | // Test get from non-existing store | ||
209 | { | ||
210 | UUID fakeStoreId = TestHelpers.ParseTail(0x500); | ||
211 | string fakeStoreValueGet = (string)InvokeOp("JsonGetValueJson", fakeStoreId, "Hello"); | ||
212 | Assert.That(fakeStoreValueGet, Is.EqualTo("")); | ||
213 | } | ||
214 | } | ||
215 | |||
183 | // [Test] | 216 | // [Test] |
184 | // public void TestJsonTakeValue() | 217 | // public void TestJsonTakeValue() |
185 | // { | 218 | // { |