/** Test method for {@link com.dell.mensa.util.LoremIpsum#getSentence(int)}. */ @Test public void testGetSentence() { for (int i = 0; i < EXPECTED_SENTENCES.length; ++i) { Assert.assertEquals( String.format("unexpected sentence[%d]; ", i), EXPECTED_SENTENCES[i], loremIpsum.getSentence(i)); } }
@Test(expected = IndexOutOfBoundsException.class) public void testGetSentence_Overflow() { loremIpsum.getSentence(loremIpsum.getNumSentences()); }
@Test(expected = IndexOutOfBoundsException.class) public void testGetSentence_Underflow() { loremIpsum.getSentence(-1); }