From 75f1e0431580975e5588b63025c7c94aedafb050 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 7 Feb 2013 23:58:19 +0000 Subject: Add tests for removing fake values/from fake store in TestJsonRemoveValue() Again, need to check if returning true for removing a value that doesn't exist is most appropriate. --- .../Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore') diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs index d341901..297c33c 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs @@ -208,6 +208,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests string returnValue2 = (string)InvokeOp("JsonGetValue", storeId, "Hello"); Assert.That(returnValue2, Is.EqualTo("")); + + // Test remove of non-existing value + int fakeValueRemove = (int)InvokeOp("JsonRemoveValue", storeId, "Hello"); + + // XXX: Is this the best response to removing a value that isn't there? + Assert.That(fakeValueRemove, Is.EqualTo(1)); + + // Test get from non-existing store + UUID fakeStoreId = TestHelpers.ParseTail(0x500); + int fakeStoreValueRemove = (int)InvokeOp("JsonRemoveValue", fakeStoreId, "Hello"); + Assert.That(fakeStoreValueRemove, Is.EqualTo(0)); } [Test] -- cgit v1.1