Advertisement
JeffGrigg

1st Test Passes

Feb 8th, 2024
1,710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.93 KB | Software | 0 0
  1. import junit.framework.TestCase;
  2.  
  3. import java.util.Arrays;
  4.  
  5. public class NBottlesOfBeerOnTheWallTest extends TestCase {
  6.  
  7.     private static String[] lyricsForBottlesOfBeer(final int numberOfBottlesOfBeer) {
  8.         return new String[]{
  9.                 "No more bottles of beer on the wall, no more bottles of beer.",
  10.                 "Go to the store and buy some more, 99 bottles of beer on the wall."};
  11.     }
  12.  
  13.     public void testZeroBottlesOfBeer() {
  14.         assertEqualsArrayValues(new String[]{
  15.                         "No more bottles of beer on the wall, no more bottles of beer.",
  16.                         "Go to the store and buy some more, 99 bottles of beer on the wall."},
  17.                 lyricsForBottlesOfBeer(0));
  18.     }
  19.  
  20.     private static void assertEqualsArrayValues(final String[] expectedLines, final String[] actualLines) {
  21.         assertEquals(Arrays.asList(expectedLines), Arrays.asList(actualLines));
  22.     }
  23.  
  24. }
  25.  
Tags: 99 Bottles
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement