Extend TestJsonCreateStore() with a one key input and an input with raw number values

0.7.4-extended
Justin Clark-Casey (justincc) 2013-02-12 23:00:24 +00:00
parent 7cacf5f8a0
commit 009178d7dd
1 changed files with 20 additions and 2 deletions

View File

@ -115,10 +115,28 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
TestHelpers.InMethod(); TestHelpers.InMethod();
// TestHelpers.EnableLogging(); // TestHelpers.EnableLogging();
// Test blank store
{
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}"); UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
Assert.That(storeId, Is.Not.EqualTo(UUID.Zero)); Assert.That(storeId, Is.Not.EqualTo(UUID.Zero));
} }
// Test single element store
{
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : 'World' }");
Assert.That(storeId, Is.Not.EqualTo(UUID.Zero));
}
// Test with an integer value
{
UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{ 'Hello' : 42.15 }");
Assert.That(storeId, Is.Not.EqualTo(UUID.Zero));
string value = (string)InvokeOp("JsonGetValue", storeId, "Hello");
Assert.That(value, Is.EqualTo("42.15"));
}
}
[Test] [Test]
public void TestJsonDestroyStore() public void TestJsonDestroyStore()
{ {