Add regression test for script func JsonRemoveValue()

0.7.4-extended
Justin Clark-Casey (justincc) 2013-01-30 05:39:34 +00:00
parent afc93d7ac4
commit 10db078aa4
1 changed files with 52 additions and 0 deletions

View File

@ -111,6 +111,58 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
Assert.That(value, Is.EqualTo("World")); Assert.That(value, Is.EqualTo("World"));
} }
// [Test]
// public void TestJsonTakeValue()
// {
// TestHelpers.InMethod();
//// TestHelpers.EnableLogging();
//
// UUID storeId
// = (UUID)m_smcm.InvokeOperation(
// UUID.Zero, UUID.Zero, "JsonCreateStore", new object[] { "{ 'Hello' : 'World' }" });
//
// string value
// = (string)m_smcm.InvokeOperation(
// UUID.Zero, UUID.Zero, "JsonTakeValue", new object[] { storeId, "Hello" });
//
// Assert.That(value, Is.EqualTo("World"));
//
// string value2
// = (string)m_smcm.InvokeOperation(
// UUID.Zero, UUID.Zero, "JsonGetValue", new object[] { storeId, "Hello" });
//
// Assert.That(value, Is.Null);
// }
[Test]
public void TestJsonRemoveValue()
{
TestHelpers.InMethod();
// TestHelpers.EnableLogging();
UUID storeId
= (UUID)m_smcm.InvokeOperation(
UUID.Zero, UUID.Zero, "JsonCreateStore", new object[] { "{ 'Hello' : 'World' }" });
int returnValue
= (int)m_smcm.InvokeOperation(
UUID.Zero, UUID.Zero, "JsonRemoveValue", new object[] { storeId, "Hello" });
Assert.That(returnValue, Is.EqualTo(1));
int result
= (int)m_smcm.InvokeOperation(
UUID.Zero, UUID.Zero, "JsonTestPath", new object[] { storeId, "Hello" });
Assert.That(result, Is.EqualTo(0));
string returnValue2
= (string)m_smcm.InvokeOperation(
UUID.Zero, UUID.Zero, "JsonGetValue", new object[] { storeId, "Hello" });
Assert.That(returnValue2, Is.EqualTo(""));
}
[Test] [Test]
public void TestJsonTestPath() public void TestJsonTestPath()
{ {