Parcourir la source

beer-song: split tests per assertion [Fix #318]

MichaelSpets il y a 9 ans
Parent
révision
147d74d5f2
1 fichiers modifiés avec 24 ajouts et 6 suppressions
  1. 24
    6
      exercises/beer-song/src/test/java/BeerSongTest.java

+ 24
- 6
exercises/beer-song/src/test/java/BeerSongTest.java Voir le fichier

@@ -5,21 +5,39 @@ import static org.junit.Assert.assertEquals;
5 5
 
6 6
 public class BeerSongTest {
7 7
 
8
+    @Test
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));
11
+    }
12
+
13
+    @Ignore
14
+    @Test
15
+    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));
17
+    }
8 18
 
19
+    @Ignore
9 20
     @Test
10
-    public void singOneVerse() {
11
-        assertEquals("8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n\n", BeerSong.verse(8));
21
+    public void singThirdToLastVerse() {
12 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));
23
+    }
24
+
25
+    @Ignore
26
+    @Test
27
+    public void singPenultimateVerse() {
13 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));
14
-        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));
29
+    }
15 30
 
31
+    @Ignore
32
+    @Test
33
+    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));
16 35
     }
17 36
 
18 37
     @Ignore
19 38
     @Test
20
-    public void singMoreThanOneVerse() {
21
-        assertEquals("8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n\n7 bottles of beer on the wall, 7 bottles of beer.\nTake one down and pass it around, 6 bottles of beer on the wall.\n\n6 bottles of beer on the wall, 6 bottles of beer.\nTake one down and pass it around, 5 bottles of beer on the wall.\n\n", BeerSong.sing(8,6));
22
-        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));
39
+    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));
23 41
     }
24 42
 
25 43
     @Ignore