001: /**
002: * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.
003: *
004: * This program is free software; you can redistribute it and/or modify
005: * it under the terms of the latest version of the GNU Lesser General
006: * Public License as published by the Free Software Foundation;
007: *
008: * This program is distributed in the hope that it will be useful,
009: * but WITHOUT ANY WARRANTY; without even the implied warranty of
010: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
011: * GNU Lesser General Public License for more details.
012: *
013: * You should have received a copy of the GNU Lesser General Public License
014: * along with this program (LICENSE.txt); if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
016: *
017: * Based on code generated by Agitar build: Agitator Version 1.0.2.000071 (Build date: Jan 12, 2007) [1.0.2.000071]
018: */package org.jamwiki.utils;
019:
020: import junit.framework.TestCase;
021:
022: /**
023: *
024: */
025: public class PaginationTest extends TestCase {
026:
027: /**
028: *
029: */
030: public void testConstructor() throws Throwable {
031: Pagination pagination = new Pagination(100, 1000);
032: assertEquals("pagination.getNumResults()", 100, pagination
033: .getNumResults());
034: assertEquals("pagination.getOffset()", 1000, pagination
035: .getOffset());
036: }
037:
038: /**
039: *
040: */
041: public void testGetEnd() throws Throwable {
042: int result = new Pagination(0, 0).getEnd();
043: assertEquals("result", 0, result);
044: }
045:
046: /**
047: *
048: */
049: public void testGetEnd1() throws Throwable {
050: int result = new Pagination(100, 1000).getEnd();
051: assertEquals("result", 1100, result);
052: }
053:
054: /**
055: *
056: */
057: public void testGetNumResults() throws Throwable {
058: int result = new Pagination(0, 100).getNumResults();
059: assertEquals("result", 0, result);
060: }
061:
062: /**
063: *
064: */
065: public void testGetNumResults1() throws Throwable {
066: int result = new Pagination(100, 1000).getNumResults();
067: assertEquals("result", 100, result);
068: }
069:
070: /**
071: *
072: */
073: public void testGetOffset() throws Throwable {
074: int result = new Pagination(100, 0).getOffset();
075: assertEquals("result", 0, result);
076: }
077:
078: /**
079: *
080: */
081: public void testGetOffset1() throws Throwable {
082: int result = new Pagination(100, 1000).getOffset();
083: assertEquals("result", 1000, result);
084: }
085:
086: /**
087: *
088: */
089: public void testGetStart() throws Throwable {
090: int result = new Pagination(100, 1000).getStart();
091: assertEquals("result", 1000, result);
092: }
093:
094: /**
095: *
096: */
097: public void testGetStart1() throws Throwable {
098: int result = new Pagination(100, 0).getStart();
099: assertEquals("result", 0, result);
100: }
101: }
|