Add test for maxsize/offset/limit collections

This commit is contained in:
hns 2009-09-15 15:26:55 +00:00
parent b0c72c989e
commit 1b58896a2e
2 changed files with 20 additions and 0 deletions

View file

@ -11,6 +11,14 @@ persons.foreign = person_org_id
persons.accessname = person_name persons.accessname = person_name
persons.order = person_name persons.order = person_name
range = collection(Person)
range.local = org_id
range.foreign = person_org_id
range.accessname = person_name
range.order = person_name
range.offset = 100
range.maxsize = 100
name = org_name name = org_name
country = org_country country = org_country

View file

@ -1,5 +1,6 @@
tests = [ tests = [
"testSize", "testSize",
"testMaxSize",
"testAddRemoveSmall", "testAddRemoveSmall",
"testAddRemoveLarge", "testAddRemoveLarge",
"testListSmall", "testListSmall",
@ -21,6 +22,17 @@ function testSize() {
assertEqual(helma.persons.size(), small); assertEqual(helma.persons.size(), small);
} }
function testMaxSize() {
assertEqual(ikea.range.size(), 100);
assertEqual(helma.range.size(), 0);
var person = ikea.range.get("Person Ikea 0150");
assertNotNull(person);
assertEqual(person, ikea.range.get(50));
assertEqual(person, ikea.persons.get(150));
assertEqual(50, ikea.range.indexOf(person));
assertEqual(150, ikea.persons.indexOf(person));
}
function testAddRemoveSmall(org) { function testAddRemoveSmall(org) {
testAddRemove(helma, small); testAddRemove(helma, small);
} }