use of com.google.firebase.firestore.model.FieldIndex.IndexOffset in project firebase-android-sdk by firebase.
the class FieldIndexTest method indexOffsetAdvancesSeconds.
@Test
public void indexOffsetAdvancesSeconds() {
IndexOffset actualSuccessor = IndexOffset.createSuccessor(version(1, (int) 1e9 - 1), -1);
IndexOffset expectedSuccessor = IndexOffset.create(version(2, 0), DocumentKey.empty(), -1);
assertEquals(expectedSuccessor, actualSuccessor);
}
use of com.google.firebase.firestore.model.FieldIndex.IndexOffset in project firebase-android-sdk by firebase.
the class FieldIndexTest method indexOffsetComparator.
@Test
public void indexOffsetComparator() {
IndexOffset docAOffset = IndexOffset.create(version(1), key("foo/a"), -1);
IndexOffset docBOffset = IndexOffset.create(version(1), key("foo/b"), -1);
IndexOffset version1Offset = IndexOffset.createSuccessor(version(1), -1);
IndexOffset docCOffset = IndexOffset.create(version(2), key("foo/c"), -1);
IndexOffset version2Offset = IndexOffset.createSuccessor(version(2), -1);
assertEquals(-1, docAOffset.compareTo(docBOffset));
assertEquals(-1, docAOffset.compareTo(version1Offset));
assertEquals(-1, version1Offset.compareTo(docCOffset));
assertEquals(-1, version1Offset.compareTo(version2Offset));
assertEquals(-1, docCOffset.compareTo(version2Offset));
}
Aggregations