瀏覽代碼

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
共有 2 個檔案被更改,包括 16 行新增3 行删除
  1. 1
    0
      exercises/twelve-days/.meta/version
  2. 15
    3
      exercises/twelve-days/src/test/java/TwelveDaysTest.java

+ 1
- 0
exercises/twelve-days/.meta/version 查看文件

1
+1.0.0

+ 15
- 3
exercises/twelve-days/src/test/java/TwelveDaysTest.java 查看文件

119
 
119
 
120
     @Ignore("Remove to run test")
120
     @Ignore("Remove to run test")
121
     @Test
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
                 "a Partridge in a Pear Tree.\n\n" +
124
                 "a Partridge in a Pear Tree.\n\n" +
125
                 "On the second day of Christmas my true love gave to me, two Turtle Doves, " +
125
                 "On the second day of Christmas my true love gave to me, two Turtle Doves, " +
126
                 "and a Partridge in a Pear Tree.\n\n" +
126
                 "and a Partridge in a Pear Tree.\n\n" +
127
                 "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, " +
128
                 "and a Partridge in a Pear Tree.\n";
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
     @Ignore("Remove to run test")
144
     @Ignore("Remove to run test")