|
|
|
|
|
|
|
|
1
|
+import org.junit.Before;
|
|
1
|
import org.junit.Ignore;
|
2
|
import org.junit.Ignore;
|
|
2
|
import org.junit.Test;
|
3
|
import org.junit.Test;
|
|
3
|
|
4
|
|
|
4
|
import static org.junit.Assert.assertEquals;
|
5
|
import static org.junit.Assert.assertEquals;
|
|
5
|
|
6
|
|
|
6
|
public class TwelveDaysTest {
|
7
|
public class TwelveDaysTest {
|
|
|
|
8
|
+ private TwelveDays twelveDays;
|
|
|
|
9
|
+
|
|
|
|
10
|
+ @Before
|
|
|
|
11
|
+ public void setup() {
|
|
|
|
12
|
+ twelveDays = new TwelveDays();
|
|
|
|
13
|
+ }
|
|
7
|
|
14
|
|
|
8
|
@Test
|
15
|
@Test
|
|
9
|
public void testVerseOne() {
|
16
|
public void testVerseOne() {
|
|
10
|
String expectedVerseOne = "On the first day of Christmas my true love gave to me, " +
|
17
|
String expectedVerseOne = "On the first day of Christmas my true love gave to me, " +
|
|
11
|
"a Partridge in a Pear Tree.\n";
|
18
|
"a Partridge in a Pear Tree.\n";
|
|
12
|
- assertEquals(expectedVerseOne, TwelveDays.verse(1));
|
|
|
|
|
|
19
|
+ assertEquals(expectedVerseOne, twelveDays.verse(1));
|
|
13
|
}
|
20
|
}
|
|
14
|
|
21
|
|
|
15
|
@Ignore
|
22
|
@Ignore
|
|
|
|
|
|
|
17
|
public void testVerseTwo() {
|
24
|
public void testVerseTwo() {
|
|
18
|
String expectedVerseTwo = "On the second day of Christmas my true love gave to me, two Turtle Doves, " +
|
25
|
String expectedVerseTwo = "On the second day of Christmas my true love gave to me, two Turtle Doves, " +
|
|
19
|
"and a Partridge in a Pear Tree.\n";
|
26
|
"and a Partridge in a Pear Tree.\n";
|
|
20
|
- assertEquals(expectedVerseTwo, TwelveDays.verse(2));
|
|
|
|
|
|
27
|
+ assertEquals(expectedVerseTwo, twelveDays.verse(2));
|
|
21
|
}
|
28
|
}
|
|
22
|
|
29
|
|
|
23
|
@Ignore
|
30
|
@Ignore
|
|
|
|
|
|
|
25
|
public void testVerseThree() {
|
32
|
public void testVerseThree() {
|
|
26
|
String expectedVerseThree = "On the third day of Christmas my true love gave to me, three French Hens, " +
|
33
|
String expectedVerseThree = "On the third day of Christmas my true love gave to me, three French Hens, " +
|
|
27
|
"two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
34
|
"two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
28
|
- assertEquals(expectedVerseThree, TwelveDays.verse(3));
|
|
|
|
|
|
35
|
+ assertEquals(expectedVerseThree, twelveDays.verse(3));
|
|
29
|
}
|
36
|
}
|
|
30
|
|
37
|
|
|
31
|
@Ignore
|
38
|
@Ignore
|
|
|
|
|
|
|
33
|
public void testVerseFour() {
|
40
|
public void testVerseFour() {
|
|
34
|
String expectedVerseFour = "On the fourth day of Christmas my true love gave to me, four Calling Birds, " +
|
41
|
String expectedVerseFour = "On the fourth day of Christmas my true love gave to me, four Calling Birds, " +
|
|
35
|
"three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
42
|
"three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
36
|
- assertEquals(expectedVerseFour, TwelveDays.verse(4));
|
|
|
|
|
|
43
|
+ assertEquals(expectedVerseFour, twelveDays.verse(4));
|
|
37
|
}
|
44
|
}
|
|
38
|
|
45
|
|
|
39
|
@Ignore
|
46
|
@Ignore
|
|
|
|
|
|
|
41
|
public void testVerseFive() {
|
48
|
public void testVerseFive() {
|
|
42
|
String expectedVerseFive = "On the fifth day of Christmas my true love gave to me, five Gold Rings, " +
|
49
|
String expectedVerseFive = "On the fifth day of Christmas my true love gave to me, five Gold Rings, " +
|
|
43
|
"four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
50
|
"four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
44
|
- assertEquals(expectedVerseFive, TwelveDays.verse(5));
|
|
|
|
|
|
51
|
+ assertEquals(expectedVerseFive, twelveDays.verse(5));
|
|
45
|
}
|
52
|
}
|
|
46
|
|
53
|
|
|
47
|
@Ignore
|
54
|
@Ignore
|
|
|
|
|
|
|
50
|
String expectedVerseSix = "On the sixth day of Christmas my true love gave to me, six Geese-a-Laying, " +
|
57
|
String expectedVerseSix = "On the sixth day of Christmas my true love gave to me, six Geese-a-Laying, " +
|
|
51
|
"five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, " +
|
58
|
"five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, " +
|
|
52
|
"and a Partridge in a Pear Tree.\n";
|
59
|
"and a Partridge in a Pear Tree.\n";
|
|
53
|
- assertEquals(expectedVerseSix, TwelveDays.verse(6));
|
|
|
|
|
|
60
|
+ assertEquals(expectedVerseSix, twelveDays.verse(6));
|
|
54
|
}
|
61
|
}
|
|
55
|
|
62
|
|
|
56
|
@Ignore
|
63
|
@Ignore
|
|
|
|
|
|
|
59
|
String expectedVerseSeven = "On the seventh day of Christmas my true love gave to me, " +
|
66
|
String expectedVerseSeven = "On the seventh day of Christmas my true love gave to me, " +
|
|
60
|
"seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, " +
|
67
|
"seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, " +
|
|
61
|
"two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
68
|
"two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
62
|
- assertEquals(expectedVerseSeven, TwelveDays.verse(7));
|
|
|
|
|
|
69
|
+ assertEquals(expectedVerseSeven, twelveDays.verse(7));
|
|
63
|
}
|
70
|
}
|
|
64
|
|
71
|
|
|
65
|
@Ignore
|
72
|
@Ignore
|
|
|
|
|
|
|
68
|
String expectedVerseEight = "On the eighth day of Christmas my true love gave to me, eight Maids-a-Milking," +
|
75
|
String expectedVerseEight = "On the eighth day of Christmas my true love gave to me, eight Maids-a-Milking," +
|
|
69
|
" seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, " +
|
76
|
" seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, " +
|
|
70
|
"three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
77
|
"three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
71
|
- assertEquals(expectedVerseEight, TwelveDays.verse(8));
|
|
|
|
|
|
78
|
+ assertEquals(expectedVerseEight, twelveDays.verse(8));
|
|
72
|
}
|
79
|
}
|
|
73
|
|
80
|
|
|
74
|
@Ignore
|
81
|
@Ignore
|
|
|
|
|
|
|
77
|
String expectedVerseNine = "On the ninth day of Christmas my true love gave to me, nine Ladies Dancing, " +
|
84
|
String expectedVerseNine = "On the ninth day of Christmas my true love gave to me, nine Ladies Dancing, " +
|
|
78
|
"eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, " +
|
85
|
"eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, " +
|
|
79
|
"four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
86
|
"four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
80
|
- assertEquals(expectedVerseNine, TwelveDays.verse(9));
|
|
|
|
|
|
87
|
+ assertEquals(expectedVerseNine, twelveDays.verse(9));
|
|
81
|
}
|
88
|
}
|
|
82
|
|
89
|
|
|
83
|
@Ignore
|
90
|
@Ignore
|
|
|
|
|
|
|
87
|
"nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, " +
|
94
|
"nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, " +
|
|
88
|
"five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, " +
|
95
|
"five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, " +
|
|
89
|
"and a Partridge in a Pear Tree.\n";
|
96
|
"and a Partridge in a Pear Tree.\n";
|
|
90
|
- assertEquals(expectedVerseTen, TwelveDays.verse(10));
|
|
|
|
|
|
97
|
+ assertEquals(expectedVerseTen, twelveDays.verse(10));
|
|
91
|
}
|
98
|
}
|
|
92
|
|
99
|
|
|
93
|
@Ignore
|
100
|
@Ignore
|
|
|
|
|
|
|
97
|
"eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, " +
|
104
|
"eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, " +
|
|
98
|
"seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, " +
|
105
|
"seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, " +
|
|
99
|
"three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
106
|
"three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
100
|
- assertEquals(expectedVerseEleven, TwelveDays.verse(11));
|
|
|
|
|
|
107
|
+ assertEquals(expectedVerseEleven, twelveDays.verse(11));
|
|
101
|
}
|
108
|
}
|
|
102
|
|
109
|
|
|
103
|
@Ignore
|
110
|
@Ignore
|
|
|
|
|
|
|
107
|
"twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, " +
|
114
|
"twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, " +
|
|
108
|
"eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, " +
|
115
|
"eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, " +
|
|
109
|
"four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
116
|
"four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
110
|
- assertEquals(expectedVerseTwelve, TwelveDays.verse(12));
|
|
|
|
|
|
117
|
+ assertEquals(expectedVerseTwelve, twelveDays.verse(12));
|
|
111
|
}
|
118
|
}
|
|
112
|
|
119
|
|
|
113
|
@Ignore
|
120
|
@Ignore
|
|
|
|
|
|
|
119
|
"and a Partridge in a Pear Tree.\n\n" +
|
126
|
"and a Partridge in a Pear Tree.\n\n" +
|
|
120
|
"On the third day of Christmas my true love gave to me, three French Hens, two Turtle Doves, " +
|
127
|
"On the third day of Christmas my true love gave to me, three French Hens, two Turtle Doves, " +
|
|
121
|
"and a Partridge in a Pear Tree.\n";
|
128
|
"and a Partridge in a Pear Tree.\n";
|
|
122
|
- assertEquals(expectedVerseOneToThree, TwelveDays.verses(1, 3));
|
|
|
|
|
|
129
|
+ assertEquals(expectedVerseOneToThree, twelveDays.verses(1, 3));
|
|
123
|
}
|
130
|
}
|
|
124
|
|
131
|
|
|
125
|
@Ignore
|
132
|
@Ignore
|
|
|
|
|
|
|
167
|
"eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, " +
|
174
|
"eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, " +
|
|
168
|
"seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, " +
|
175
|
"seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, " +
|
|
169
|
"three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
176
|
"three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
170
|
- assertEquals(expectedSong, TwelveDays.sing());
|
|
|
|
|
|
177
|
+ assertEquals(expectedSong, twelveDays.sing());
|
|
171
|
}
|
178
|
}
|
|
172
|
}
|
179
|
}
|