private void MakeSureUncommittedChangesAreSortedCorrectly(EntityCreator <PropertyContainer> creator, TimelineIndex <PropertyContainer> timeline) { LinkedList <Pair <PropertyContainer, long> > timestamps = CreateTimestamps(creator, timeline, 300000, 100000, 500000, 900000, 800000); using (Transaction tx = _db.beginTx()) { timestamps.addAll(CreateTimestamps(creator, timeline, 40000, 70000, 20000)); assertEquals(SortedEntities(timestamps, false), asCollection(timeline.GetBetween(null, null).GetEnumerator())); tx.Success(); } using (Transaction ignore = _db.beginTx()) { assertEquals(SortedEntities(timestamps, false), asCollection(timeline.GetBetween(null, null).GetEnumerator())); } }
private void MakeSureWeCanQueryLowerDefaultThan1970(EntityCreator <PropertyContainer> creator, TimelineIndex <PropertyContainer> timeline) { LinkedList <Pair <PropertyContainer, long> > timestamps = CreateTimestamps(creator, timeline, -10000, 0, 10000); using (Transaction tx = _db.beginTx()) { assertEquals(SortedEntities(timestamps, true), asCollection(timeline.GetBetween(null, 10000L, true).GetEnumerator())); tx.Success(); } }
private void MakeSureRangesAreReturnedInCorrectReversedOrder(EntityCreator <PropertyContainer> creator, TimelineIndex <PropertyContainer> timeline) { LinkedList <Pair <PropertyContainer, long> > timestamps = CreateTimestamps(creator, timeline, 300000, 200000, 199999, 400000, 100000, 500000, 600000, 900000, 800000); using (Transaction tx = _db.beginTx()) { assertEquals(SortedEntities(timestamps, true), asCollection(timeline.GetBetween(null, null, true).GetEnumerator())); tx.Success(); } }