Преглед изворни кода

beer-song: add more line breaks [Fix #317]

MichaelSpets пре 9 година
родитељ
комит
e4bba7e2c8
1 измењених фајлова са 24 додато и 6 уклоњено
  1. 24
    6
      exercises/beer-song/src/test/java/BeerSongTest.java

+ 24
- 6
exercises/beer-song/src/test/java/BeerSongTest.java Прегледај датотеку

@@ -7,37 +7,55 @@ public class BeerSongTest {
7 7
 
8 8
     @Test
9 9
     public void singFirstVerse() {
10
-        assertEquals("99 bottles of beer on the wall, 99 bottles of beer.\nTake one down and pass it around, 98 bottles of beer on the wall.\n\n", BeerSong.verse(99));
10
+        assertEquals("99 bottles of beer on the wall, 99 bottles of beer.\n" +
11
+                        "Take one down and pass it around, 98 bottles of beer on the wall.\n\n",
12
+                BeerSong.verse(99));
11 13
     }
12 14
 
13 15
     @Ignore
14 16
     @Test
15 17
     public void singMiddleVerse() {
16
-        assertEquals("44 bottles of beer on the wall, 44 bottles of beer.\nTake one down and pass it around, 43 bottles of beer on the wall.\n\n", BeerSong.verse(44));
18
+        assertEquals("44 bottles of beer on the wall, 44 bottles of beer.\n" +
19
+                        "Take one down and pass it around, 43 bottles of beer on the wall.\n\n",
20
+                BeerSong.verse(44));
17 21
     }
18 22
 
19 23
     @Ignore
20 24
     @Test
21 25
     public void singThirdToLastVerse() {
22
-        assertEquals("2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n", BeerSong.verse(2));
26
+        assertEquals("2 bottles of beer on the wall, 2 bottles of beer.\n" +
27
+                        "Take one down and pass it around, 1 bottle of beer on the wall.\n\n",
28
+                BeerSong.verse(2));
23 29
     }
24 30
 
25 31
     @Ignore
26 32
     @Test
27 33
     public void singPenultimateVerse() {
28
-        assertEquals("1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n\n", BeerSong.verse(1));
34
+        assertEquals("1 bottle of beer on the wall, 1 bottle of beer.\n" +
35
+                        "Take it down and pass it around, no more bottles of beer on the wall.\n\n",
36
+                BeerSong.verse(1));
29 37
     }
30 38
 
31 39
     @Ignore
32 40
     @Test
33 41
     public void singLastVerse() {
34
-        assertEquals("No more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n\n", BeerSong.verse(0));
42
+        assertEquals("No more bottles of beer on the wall, no more bottles of beer.\n" +
43
+                        "Go to the store and buy some more, 99 bottles of beer on the wall.\n\n",
44
+                BeerSong.verse(0));
35 45
     }
36 46
 
37 47
     @Ignore
38 48
     @Test
39 49
     public void singLastFourVerses() {
40
-        assertEquals("3 bottles of beer on the wall, 3 bottles of beer.\nTake one down and pass it around, 2 bottles of beer on the wall.\n\n2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n\n", BeerSong.sing(3,0));
50
+        assertEquals("3 bottles of beer on the wall, 3 bottles of beer.\n" +
51
+                        "Take one down and pass it around, 2 bottles of beer on the wall.\n\n" +
52
+                        "2 bottles of beer on the wall, 2 bottles of beer.\n" +
53
+                        "Take one down and pass it around, 1 bottle of beer on the wall.\n\n" +
54
+                        "1 bottle of beer on the wall, 1 bottle of beer.\n" +
55
+                        "Take it down and pass it around, no more bottles of beer on the wall.\n\n" +
56
+                        "No more bottles of beer on the wall, no more bottles of beer.\n" +
57
+                        "Go to the store and buy some more, 99 bottles of beer on the wall.\n\n",
58
+                BeerSong.sing(3,0));
41 59
     }
42 60
 
43 61
     @Ignore