Package br.com.objectos.way.relational

Examples of br.com.objectos.way.relational.Page.previous()


    assertThat(page.getFirstIndex(), equalTo(0));

    page.next(); // 1
    page.next(); // 2
    page.next(); // 3
    page.previous(); // 2

    assertThat(page.getFirstIndex(), equalTo(2 * length));
    assertThat(page.getNumber(), equalTo(2));
  }

View Full Code Here


    Page page = SimplePage.build().withLengthOf(length).get();
    assertThat(page.getFirstIndex(), equalTo(0));

    page.next(); // 5
    page.next(); // 10
    page.previous(); // 5
    page.previous(); // 0
    page.previous(); // 0 (not -5)

    assertThat(page.getFirstIndex(), equalTo(0));
    assertThat(page.getNumber(), equalTo(0));
View Full Code Here

    assertThat(page.getFirstIndex(), equalTo(0));

    page.next(); // 5
    page.next(); // 10
    page.previous(); // 5
    page.previous(); // 0
    page.previous(); // 0 (not -5)

    assertThat(page.getFirstIndex(), equalTo(0));
    assertThat(page.getNumber(), equalTo(0));
  }
View Full Code Here

    page.next(); // 5
    page.next(); // 10
    page.previous(); // 5
    page.previous(); // 0
    page.previous(); // 0 (not -5)

    assertThat(page.getFirstIndex(), equalTo(0));
    assertThat(page.getNumber(), equalTo(0));
  }
View Full Code Here

    int startIndex = 11;
    int length = 5;
    Page page = SimplePage.build().startAt(startIndex).withLengthOf(length).get();
    assertThat(page.getNumber(), equalTo(2));

    page.previous();
    assertThat(page.getFirstIndex(), equalTo(6));
    assertThat(page.getNumber(), equalTo(1));

    page.previous();
    assertThat(page.getFirstIndex(), equalTo(1));
View Full Code Here

    page.previous();
    assertThat(page.getFirstIndex(), equalTo(6));
    assertThat(page.getNumber(), equalTo(1));

    page.previous();
    assertThat(page.getFirstIndex(), equalTo(1));
    assertThat(page.getNumber(), equalTo(0));

    page.previous();
    assertThat(page.getFirstIndex(), equalTo(0));
View Full Code Here

    page.previous();
    assertThat(page.getFirstIndex(), equalTo(1));
    assertThat(page.getNumber(), equalTo(0));

    page.previous();
    assertThat(page.getFirstIndex(), equalTo(0));
    assertThat(page.getNumber(), equalTo(0));
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.