Add test for maxsize/offset/limit collections
This commit is contained in:
parent
b0c72c989e
commit
1b58896a2e
2 changed files with 20 additions and 0 deletions
|
@ -11,6 +11,14 @@ persons.foreign = person_org_id
|
|||
persons.accessname = 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
|
||||
country = org_country
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
tests = [
|
||||
"testSize",
|
||||
"testMaxSize",
|
||||
"testAddRemoveSmall",
|
||||
"testAddRemoveLarge",
|
||||
"testListSmall",
|
||||
|
@ -21,6 +22,17 @@ function testSize() {
|
|||
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) {
|
||||
testAddRemove(helma, small);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue