From 5be2483e93737702ad64af6ab606b7c197d380cc Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 7 Feb 2013 23:58:19 +0000 Subject: [PATCH] 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. --- .../JsonStore/Tests/JsonStoreScriptModuleTests.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs index d341901e68..297c33cc9d 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]