@Test public void testClone() { assertEquals(gen11, gen11.clone()); assertEquals(gen11, gen11.clone()); assertEquals(rev99, rev99.clone()); assertEquals(rev99, rev99.clone()); }
@Test public void testGetOrdinal() { assertEquals(4, gen11.getOrdinal()); assertEquals(5, gen12.getOrdinal()); assertEquals(36, gen21.getOrdinal()); assertEquals(37, gen22.getOrdinal()); assertEquals(31935, rev11.getOrdinal()); assertEquals(31936, rev12.getOrdinal()); assertEquals(31956, rev21.getOrdinal()); assertEquals(31957, rev22.getOrdinal()); assertEquals(32359, rev99.getOrdinal()); }
@Test public void testGetVerse() { assertEquals(gen11.getVerse(), 1); assertEquals(gen12.getVerse(), 2); assertEquals(gen21.getVerse(), 1); assertEquals(gen22.getVerse(), 2); assertEquals(rev11.getVerse(), 1); assertEquals(rev12.getVerse(), 2); assertEquals(rev21.getVerse(), 1); assertEquals(rev22.getVerse(), 2); assertEquals(rev99.getVerse(), 21); }
@Test public void testGetChapter() { assertEquals(gen11.getChapter(), 1); assertEquals(gen12.getChapter(), 1); assertEquals(gen21.getChapter(), 2); assertEquals(gen22.getChapter(), 2); assertEquals(rev11.getChapter(), 1); assertEquals(rev12.getChapter(), 1); assertEquals(rev21.getChapter(), 2); assertEquals(rev22.getChapter(), 2); assertEquals(rev99.getChapter(), 22); }
@Test public void testGetBook() { assertEquals(gen11.getBook(), BibleBook.GEN); assertEquals(gen12.getBook(), BibleBook.GEN); assertEquals(gen21.getBook(), BibleBook.GEN); assertEquals(gen22.getBook(), BibleBook.GEN); assertEquals(rev11.getBook(), BibleBook.REV); assertEquals(rev12.getBook(), BibleBook.REV); assertEquals(rev21.getBook(), BibleBook.REV); assertEquals(rev22.getBook(), BibleBook.REV); assertEquals(rev99.getBook(), BibleBook.REV); }
@Test public void testToString() { assertEquals("Gen 1:1", gen11.toString()); assertEquals("Gen 1:2", gen12.toString()); assertEquals("Gen 2:1", gen21.toString()); assertEquals("Gen 2:2", gen22.toString()); assertEquals("Rev 1:1", rev11.toString()); assertEquals("Rev 1:2", rev12.toString()); assertEquals("Rev 2:1", rev21.toString()); assertEquals("Rev 2:2", rev22.toString()); assertEquals("Rev 22:21", rev99.toString()); }
@Test public void testEquals() { assertTrue(!gen11.equals(null)); assertTrue(!gen11.equals(Integer.valueOf(0))); assertTrue(!gen11.equals("org.crosswire.jsword.passage.Verse")); assertTrue(gen11.equals(gen11a)); assertTrue(!gen11.equals(gen12)); assertTrue(!gen11.equals(rev99)); assertTrue(!gen11.equals(gen12)); }
@Test public void testAddSubtract() { assertEquals(v11n.distance(gen11, gen12), 1); assertEquals(v11n.distance(gen11, gen11), 0); assertEquals(v11n.distance(gen12, gen11), -1); Verse last = gen11.clone(); for (int i = 0; i < v11n.maximumOrdinal(); i += 99) { Verse next = v11n.add(last, i); assertEquals(v11n.distance(last, next), i); Verse next2 = v11n.subtract(next, i); assertEquals(gen11.getOsisID(), gen11, next2); } assertEquals(gen11.getOsisID(), gen11, v11n.subtract(gen11, 0)); assertEquals(gen11.getOsisID(), gen10, v11n.subtract(gen11, 1)); assertEquals(gen11.getOsisID(), gen00, v11n.subtract(gen11, 2)); assertEquals(gen11.getOsisID(), gen11, v11n.add(gen11, 0)); assertEquals(rev99.getOsisID(), rev99, v11n.add(rev99, 0)); assertEquals(rev99.getOsisID(), rev99, v11n.add(rev99, 1)); assertEquals(rev99.getOsisID(), rev99, v11n.add(rev99, 2)); }
@Test public void testVerseHasName() { Verse v = new Verse(Versifications.instance().getVersification(Versifications.DEFAULT_V11N), 5); assertEquals("Gen 1:2", v.getName()); }
@Test public void testToVerseArray() { assertEquals(gen11.toVerseArray().length, 1); }
@Test public void testCompareTo() { assertTrue(gen11.compareTo(rev99) < 0); assertTrue(rev99.compareTo(gen11) > 0); assertEquals(gen11.compareTo(gen11), 0); }
@Test public void testHashCode() { assertEquals(gen11.hashCode(), gen11a.hashCode()); assertTrue(gen11.hashCode() != 0); }