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.
0.7.4-extended
Justin Clark-Casey (justincc) 2013-02-07 23:58:19 +00:00
parent 6418b89fd6
commit 5be2483e93
1 changed files with 11 additions and 0 deletions

View File

@ -208,6 +208,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
string returnValue2 = (string)InvokeOp("JsonGetValue", storeId, "Hello"); string returnValue2 = (string)InvokeOp("JsonGetValue", storeId, "Hello");
Assert.That(returnValue2, Is.EqualTo("")); 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] [Test]