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

TwelveDaysTest Update (#1243)

* Create Version File for Twelve-Days Challenge

Takes care of part of #1135

* Update TwelveDays.java

Checked and revised code up to the comment. Will finish the rest soon.

* Update TwelveDaysTest.java

Closes #1135

Quick question: Why add two new lines after each verse in the methods testing for multiple verses?

* Update TwelveDaysTest.java

Fixing based on reviews

* Update TwelveDaysTest.java

Fixed error

* Update TwelveDays.java

* Update TwelveDaysTest.java
Kyle P пре 8 година
родитељ
комит
32496a800c

+ 1
- 0
exercises/twelve-days/.meta/version Прегледај датотеку

@@ -0,0 +1 @@
1
+1.0.0

+ 15
- 3
exercises/twelve-days/src/test/java/TwelveDaysTest.java Прегледај датотеку

@@ -119,14 +119,26 @@ public class TwelveDaysTest {
119 119
 
120 120
     @Ignore("Remove to run test")
121 121
     @Test
122
-    public void testMultipleVerses() {
123
-        String expectedVerseOneToThree = "On the first day of Christmas my true love gave to me, " +
122
+    public void testFirstThreeVerses() {
123
+        String expectedVersesOneToThree = "On the first day of Christmas my true love gave to me, " +
124 124
                 "a Partridge in a Pear Tree.\n\n" +
125 125
                 "On the second day of Christmas my true love gave to me, two Turtle Doves, " +
126 126
                 "and a Partridge in a Pear Tree.\n\n" +
127 127
                 "On the third day of Christmas my true love gave to me, three French Hens, two Turtle Doves, " +
128 128
                 "and a Partridge in a Pear Tree.\n";
129
-        assertEquals(expectedVerseOneToThree, twelveDays.verses(1, 3));
129
+        assertEquals(expectedVersesOneToThree, twelveDays.verses(1, 3));
130
+    }
131
+
132
+    @Ignore("Remove to run test")
133
+    @Test
134
+    public void testFourthToSixthVerses() {
135
+        String expectedVersesFourToSix = "On the fourth day of Christmas my true love gave to me, " + 
136
+                "four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n\n" +
137
+                "On the fifth day of Christmas my true love gave to me, five Gold Rings, four Calling Birds, " + 
138
+                "three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n\n" +
139
+                "On the sixth day of Christmas my true love gave to me, six Geese-a-Laying, five Gold Rings, " + 
140
+                "four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
141
+        assertEquals(expectedVersesFourToSix, twelveDays.verses(4, 6));
130 142
     }
131 143
 
132 144
     @Ignore("Remove to run test")