Extend TestJsonTestPath() for non-terminating section of path (i.e. one that does not point to a value/leaf)
parent
cbb8d82c7d
commit
8fcfd82241
|
@ -224,19 +224,31 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
|
|||
TestHelpers.InMethod();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : 'World' }");
|
||||
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : { 'World' : 'One' } }");
|
||||
|
||||
int result = (int)InvokeOp("JsonTestPath", storeId, "Hello");
|
||||
{
|
||||
int result = (int)InvokeOp("JsonTestPath", storeId, "Hello.World");
|
||||
Assert.That(result, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
// Test for path which does not resolve to a value.
|
||||
{
|
||||
int result = (int)InvokeOp("JsonTestPath", storeId, "Hello");
|
||||
Assert.That(result, Is.EqualTo(0));
|
||||
}
|
||||
|
||||
{
|
||||
int result2 = (int)InvokeOp("JsonTestPath", storeId, "foo");
|
||||
Assert.That(result2, Is.EqualTo(0));
|
||||
}
|
||||
|
||||
// Test with fake store
|
||||
{
|
||||
UUID fakeStoreId = TestHelpers.ParseTail(0x500);
|
||||
int fakeStoreValueRemove = (int)InvokeOp("JsonTestPath", fakeStoreId, "Hello");
|
||||
Assert.That(fakeStoreValueRemove, Is.EqualTo(0));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestJsonSetValue()
|
||||
|
|
Loading…
Reference in New Issue