|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+import org.junit.Ignore;
|
|
|
2
|
+import org.junit.Test;
|
|
|
3
|
+
|
|
|
4
|
+import static org.junit.Assert.assertEquals;
|
|
|
5
|
+
|
|
|
6
|
+public class TwelveDaysTest {
|
|
|
7
|
+
|
|
|
8
|
+ @Test
|
|
|
9
|
+ public void testVerseOne() {
|
|
|
10
|
+ String expectedVerseOne = "On the first day of Christmas my true love gave to me, " +
|
|
|
11
|
+ "a Partridge in a Pear Tree.\n";
|
|
|
12
|
+ assertEquals(expectedVerseOne, TwelveDays.verse(1));
|
|
|
13
|
+ }
|
|
|
14
|
+
|
|
|
15
|
+ @Ignore
|
|
|
16
|
+ @Test
|
|
|
17
|
+ public void testVerseTwo() {
|
|
|
18
|
+ 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";
|
|
|
20
|
+ assertEquals(expectedVerseTwo, TwelveDays.verse(2));
|
|
|
21
|
+ }
|
|
|
22
|
+
|
|
|
23
|
+ @Ignore
|
|
|
24
|
+ @Test
|
|
|
25
|
+ public void testVerseThree() {
|
|
|
26
|
+ 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";
|
|
|
28
|
+ assertEquals(expectedVerseThree, TwelveDays.verse(3));
|
|
|
29
|
+ }
|
|
|
30
|
+
|
|
|
31
|
+ @Ignore
|
|
|
32
|
+ @Test
|
|
|
33
|
+ public void testVerseFour() {
|
|
|
34
|
+ 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";
|
|
|
36
|
+ assertEquals(expectedVerseFour, TwelveDays.verse(4));
|
|
|
37
|
+ }
|
|
|
38
|
+
|
|
|
39
|
+ @Ignore
|
|
|
40
|
+ @Test
|
|
|
41
|
+ public void testVerseFive() {
|
|
|
42
|
+ 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";
|
|
|
44
|
+ assertEquals(expectedVerseFive, TwelveDays.verse(5));
|
|
|
45
|
+ }
|
|
|
46
|
+
|
|
|
47
|
+ @Ignore
|
|
|
48
|
+ @Test
|
|
|
49
|
+ public void testVerseSix() {
|
|
|
50
|
+ 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, " +
|
|
|
52
|
+ "and a Partridge in a Pear Tree.\n";
|
|
|
53
|
+ assertEquals(expectedVerseSix, TwelveDays.verse(6));
|
|
|
54
|
+ }
|
|
|
55
|
+
|
|
|
56
|
+ @Ignore
|
|
|
57
|
+ @Test
|
|
|
58
|
+ public void testVerseSeven() {
|
|
|
59
|
+ 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, " +
|
|
|
61
|
+ "two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
|
62
|
+ assertEquals(expectedVerseSeven, TwelveDays.verse(7));
|
|
|
63
|
+ }
|
|
|
64
|
+
|
|
|
65
|
+ @Ignore
|
|
|
66
|
+ @Test
|
|
|
67
|
+ public void testVerseEight() {
|
|
|
68
|
+ 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, " +
|
|
|
70
|
+ "three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
|
71
|
+ assertEquals(expectedVerseEight, TwelveDays.verse(8));
|
|
|
72
|
+ }
|
|
|
73
|
+
|
|
|
74
|
+ @Ignore
|
|
|
75
|
+ @Test
|
|
|
76
|
+ public void testVerseNine() {
|
|
|
77
|
+ 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, " +
|
|
|
79
|
+ "four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
|
80
|
+ assertEquals(expectedVerseNine, TwelveDays.verse(9));
|
|
|
81
|
+ }
|
|
|
82
|
+
|
|
|
83
|
+ @Ignore
|
|
|
84
|
+ @Test
|
|
|
85
|
+ public void testVerseTen() {
|
|
|
86
|
+ String expectedVerseTen = "On the tenth day of Christmas my true love gave to me, ten Lords-a-Leaping, " +
|
|
|
87
|
+ "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, " +
|
|
|
89
|
+ "and a Partridge in a Pear Tree.\n";
|
|
|
90
|
+ assertEquals(expectedVerseTen, TwelveDays.verse(10));
|
|
|
91
|
+ }
|
|
|
92
|
+
|
|
|
93
|
+ @Ignore
|
|
|
94
|
+ @Test
|
|
|
95
|
+ public void testVerseEleven() {
|
|
|
96
|
+ String expectedVerseEleven = "On the eleventh day of Christmas my true love gave to me, " +
|
|
|
97
|
+ "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, " +
|
|
|
99
|
+ "three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
|
100
|
+ assertEquals(expectedVerseEleven, TwelveDays.verse(11));
|
|
|
101
|
+ }
|
|
|
102
|
+
|
|
|
103
|
+ @Ignore
|
|
|
104
|
+ @Test
|
|
|
105
|
+ public void testVerseTwelve() {
|
|
|
106
|
+ String expectedVerseTwelve = "On the twelfth day of Christmas my true love gave to me, " +
|
|
|
107
|
+ "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, " +
|
|
|
109
|
+ "four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
|
110
|
+ assertEquals(expectedVerseTwelve, TwelveDays.verse(12));
|
|
|
111
|
+ }
|
|
|
112
|
+
|
|
|
113
|
+ @Ignore
|
|
|
114
|
+ @Test
|
|
|
115
|
+ public void testMultipleVerses() {
|
|
|
116
|
+ String expectedVerseOneToThree = "On the first day of Christmas my true love gave to me, " +
|
|
|
117
|
+ "a Partridge in a Pear Tree.\n\n" +
|
|
|
118
|
+ "On the second day of Christmas my true love gave to me, two Turtle Doves, " +
|
|
|
119
|
+ "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, " +
|
|
|
121
|
+ "and a Partridge in a Pear Tree.\n";
|
|
|
122
|
+ assertEquals(expectedVerseOneToThree, TwelveDays.verses(1, 3));
|
|
|
123
|
+ }
|
|
|
124
|
+
|
|
|
125
|
+ @Ignore
|
|
|
126
|
+ @Test
|
|
|
127
|
+ public void testSingWholeSong() {
|
|
|
128
|
+ String expectedSong = "On the first day of Christmas my true love gave to me, a Partridge in a Pear Tree.\n" +
|
|
|
129
|
+ "\n" +
|
|
|
130
|
+ "On the second day of Christmas my true love gave to me, two Turtle Doves, " +
|
|
|
131
|
+ "and a Partridge in a Pear Tree.\n" +
|
|
|
132
|
+ "\n" +
|
|
|
133
|
+ "On the third day of Christmas my true love gave to me, three French Hens, two Turtle Doves, " +
|
|
|
134
|
+ "and a Partridge in a Pear Tree.\n" +
|
|
|
135
|
+ "\n" +
|
|
|
136
|
+ "On the fourth day of Christmas my true love gave to me, four Calling Birds, three French Hens, " +
|
|
|
137
|
+ "two Turtle Doves, and a Partridge in a Pear Tree.\n" +
|
|
|
138
|
+ "\n" +
|
|
|
139
|
+ "On the fifth day of Christmas my true love gave to me, five Gold Rings, four Calling Birds, " +
|
|
|
140
|
+ "three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n" +
|
|
|
141
|
+ "\n" +
|
|
|
142
|
+ "On the sixth day of Christmas my true love gave to me, six Geese-a-Laying, five Gold Rings, " +
|
|
|
143
|
+ "four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n" +
|
|
|
144
|
+ "\n" +
|
|
|
145
|
+ "On the seventh day of Christmas my true love gave to me, seven Swans-a-Swimming, " +
|
|
|
146
|
+ "six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, " +
|
|
|
147
|
+ "and a Partridge in a Pear Tree.\n" +
|
|
|
148
|
+ "\n" +
|
|
|
149
|
+ "On the eighth day of Christmas my true love gave to me, eight Maids-a-Milking, " +
|
|
|
150
|
+ "seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, " +
|
|
|
151
|
+ "three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n" +
|
|
|
152
|
+ "\n" +
|
|
|
153
|
+ "On the ninth day of Christmas my true love gave to me, nine Ladies Dancing, eight Maids-a-Milking," +
|
|
|
154
|
+ " seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, " +
|
|
|
155
|
+ "three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n" +
|
|
|
156
|
+ "\n" +
|
|
|
157
|
+ "On the tenth day of Christmas my true love gave to me, ten Lords-a-Leaping, nine Ladies Dancing," +
|
|
|
158
|
+ " eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, " +
|
|
|
159
|
+ "four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n" +
|
|
|
160
|
+ "\n" +
|
|
|
161
|
+ "On the eleventh day of Christmas my true love gave to me, eleven Pipers Piping, " +
|
|
|
162
|
+ "ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, " +
|
|
|
163
|
+ "six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, " +
|
|
|
164
|
+ "and a Partridge in a Pear Tree.\n" +
|
|
|
165
|
+ "\n" +
|
|
|
166
|
+ "On the twelfth day of Christmas my true love gave to me, twelve Drummers Drumming, " +
|
|
|
167
|
+ "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, " +
|
|
|
169
|
+ "three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
|
|
|
170
|
+ assertEquals(expectedSong, TwelveDays.sing());
|
|
|
171
|
+ }
|
|
|
172
|
+}
|