Exemplo n.º 1
0
 /** 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));
   }
 }
Exemplo n.º 2
0
 @Test(expected = IndexOutOfBoundsException.class)
 public void testGetSentence_Overflow() {
   loremIpsum.getSentence(loremIpsum.getNumSentences());
 }
Exemplo n.º 3
0
 @Test(expected = IndexOutOfBoundsException.class)
 public void testGetSentence_Underflow() {
   loremIpsum.getSentence(-1);
 }