use of com.vaadin.flow.internal.Range in project flow by vaadin.
the class RangeTest method split_valueBefore.
@Test
public void split_valueBefore() {
Range range = Range.between(10, 20);
Range[] splitRanges = range.splitAt(5);
assertEquals(Range.between(10, 10), splitRanges[0]);
assertEquals(range, splitRanges[1]);
}
use of com.vaadin.flow.internal.Range in project flow by vaadin.
the class RangeTest method combine_intersecting.
@Test
public void combine_intersecting() {
Range r1 = Range.between(0, 10);
Range r2 = Range.between(5, 15);
// Test both ways, should give the same result
Range combined1 = r1.combineWith(r2);
Range combined2 = r2.combineWith(r1);
assertEquals(combined1, combined2);
assertEquals(0, combined1.getStart());
assertEquals(15, combined1.getEnd());
}
use of com.vaadin.flow.internal.Range in project flow by vaadin.
the class RangeTest method split_valueAfter.
@Test
public void split_valueAfter() {
Range range = Range.between(10, 20);
Range[] splitRanges = range.splitAt(25);
assertEquals(range, splitRanges[0]);
assertEquals(Range.between(20, 20), splitRanges[1]);
}
Aggregations