11import org .junit .Test ;
22import org .junit .Ignore ;
3+ import org .junit .Before ;
34
45import static org .junit .Assert .assertEquals ;
56
67public class BeerSongTest {
78
9+ private BeerSong beerSong ;
10+
11+ @ Before
12+ public void setup (){
13+ beerSong = new BeerSong ();
14+ }
15+
816 @ Test
917 public void singFirstVerse () {
1018 assertEquals ("99 bottles of beer on the wall, 99 bottles of beer.\n " +
1119 "Take one down and pass it around, 98 bottles of beer on the wall.\n \n " ,
12- BeerSong .verse (99 ));
20+ beerSong .verse (99 ));
1321 }
1422
1523 @ Ignore
1624 @ Test
1725 public void singMiddleVerse () {
1826 assertEquals ("44 bottles of beer on the wall, 44 bottles of beer.\n " +
1927 "Take one down and pass it around, 43 bottles of beer on the wall.\n \n " ,
20- BeerSong .verse (44 ));
28+ beerSong .verse (44 ));
2129 }
2230
2331 @ Ignore
2432 @ Test
2533 public void singThirdToLastVerse () {
2634 assertEquals ("2 bottles of beer on the wall, 2 bottles of beer.\n " +
2735 "Take one down and pass it around, 1 bottle of beer on the wall.\n \n " ,
28- BeerSong .verse (2 ));
36+ beerSong .verse (2 ));
2937 }
3038
3139 @ Ignore
3240 @ Test
3341 public void singPenultimateVerse () {
3442 assertEquals ("1 bottle of beer on the wall, 1 bottle of beer.\n " +
3543 "Take it down and pass it around, no more bottles of beer on the wall.\n \n " ,
36- BeerSong .verse (1 ));
44+ beerSong .verse (1 ));
3745 }
3846
3947 @ Ignore
4048 @ Test
4149 public void singLastVerse () {
4250 assertEquals ("No more bottles of beer on the wall, no more bottles of beer.\n " +
4351 "Go to the store and buy some more, 99 bottles of beer on the wall.\n \n " ,
44- BeerSong .verse (0 ));
52+ beerSong .verse (0 ));
4553 }
4654
4755 @ Ignore
@@ -55,7 +63,7 @@ public void singLastFourVerses() {
5563 "Take it down and pass it around, no more bottles of beer on the wall.\n \n " +
5664 "No more bottles of beer on the wall, no more bottles of beer.\n " +
5765 "Go to the store and buy some more, 99 bottles of beer on the wall.\n \n " ,
58- BeerSong .sing (3 ,0 ));
66+ beerSong .sing (3 ,0 ));
5967 }
6068
6169 @ Ignore
@@ -161,7 +169,7 @@ public void singEntireSong() {
161169 "2 bottles of beer on the wall, 2 bottles of beer.\n Take one down and pass it around, 1 bottle of beer on the wall.\n \n " +
162170 "1 bottle of beer on the wall, 1 bottle of beer.\n Take it down and pass it around, no more bottles of beer on the wall.\n \n " +
163171 "No more bottles of beer on the wall, no more bottles of beer.\n Go to the store and buy some more, 99 bottles of beer on the wall.\n \n " ,
164- BeerSong .singSong ());
172+ beerSong .singSong ());
165173 }
166174
167175}
0 commit comments