Skip to content

Commit 6aa5e96

Browse files
PropertyQueryTest: count with 0.
1 parent 7f19bcc commit 6aa5e96

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/objectbox-java-test/src/test/java/io/objectbox/query/PropertyQueryTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,18 +422,21 @@ public void testFindShorts_wrongPropertyType() {
422422

423423
@Test
424424
public void testCount() {
425+
Query<TestEntity> query = box.query().build();
426+
PropertyQuery stringQuery = query.property(simpleString);
427+
428+
assertEquals(0, stringQuery.count());
429+
425430
putTestEntity(null, 1000);
426431
putTestEntity("BAR", 100);
427432
putTestEntitiesStrings();
428433
putTestEntity("banana", 101);
429-
Query<TestEntity> query = box.query().build();
430-
PropertyQuery stringQuery = query.property(simpleString);
434+
431435
assertEquals(8, query.count());
432436
assertEquals(7, stringQuery.count());
433437
assertEquals(6, stringQuery.distinct().count());
434438
}
435439

436-
437440
@Test
438441
public void testAggregates() {
439442
putTestEntitiesScalars();

0 commit comments

Comments
 (0)