* Tests <code>getViewIndexAtPosition()</code> when views represent portions
* of elements.
*/
public void testGetViewIndexAtPositionPartial() {
assertEquals(0, view.getViewCount());
final ViewFactory vf = new ChildrenFactory();
final Element first = root.getElement(0);
final Element second = root.getElement(1);
final int middle = (first.getStartOffset() + first.getEndOffset()) / 2;
View[] views = new View[] { new ElementPartView(first, first.getStartOffset(), middle),
new ElementPartView(first, middle, first.getEndOffset()), vf.create(second) };
view.replace(0, 0, views);
assertEquals(-1, view.getViewIndexAtPosition(-1));
assertEquals(0, view.getViewIndexAtPosition(first.getStartOffset()));
assertEquals(0, view.getViewIndexAtPosition(middle - 1));
assertEquals(1, view.getViewIndexAtPosition(middle));