Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twelve-days: create and validate starter implementation #683

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
5 changes: 5 additions & 0 deletions exercises/twelve-days/src/main/java/TwelveDays.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class TwelveDays {
public String verse(int verseNumber) {
throw new UnsupportedOperationException("Delete this statement and provide your own implementation.");
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please indent with 4 spaces for consistency.

4 changes: 4 additions & 0 deletions exercises/twelve-days/src/test/java/TwelveDaysTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,21 @@ public void testVerseTwelve() {
@Ignore("Remove to run test")
@Test
public void testMultipleVerses() {
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The more I think about this strategy, the more convinced I am that the net effect is more confusing than useful. I think that's because:

  • only a few exercises require more than one method;
  • that tests are commented out is potentially really non-obvious to users.

IMO it would be simpler to say: full API stubs for exercises 1-20: no stubs or class only stubs for exercises 21+ (with exceptions for really tricky signatures as in list-ops).

Thoughts, @FridaTveit @Smarticles101?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking the same thing when reading the policies doc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome; in light of that consensus, please update this PR to include stubs of both methods and no commented-out tests; I'll update the policies doc right now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Doc updated.)

String expectedVerseOneToThree = "On the first day of Christmas my true love gave to me, " +
"a Partridge in a Pear Tree.\n\n" +
"On the second day of Christmas my true love gave to me, two Turtle Doves, " +
"and a Partridge in a Pear Tree.\n\n" +
"On the third day of Christmas my true love gave to me, three French Hens, two Turtle Doves, " +
"and a Partridge in a Pear Tree.\n";
assertEquals(expectedVerseOneToThree, twelveDays.verses(1, 3));
*/
}

@Ignore("Remove to run test")
@Test
public void testSingWholeSong() {
/*
String expectedSong = "On the first day of Christmas my true love gave to me, a Partridge in a Pear Tree.\n" +
"\n" +
"On the second day of Christmas my true love gave to me, two Turtle Doves, " +
Expand Down Expand Up @@ -175,5 +178,6 @@ public void testSingWholeSong() {
"seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, " +
"three French Hens, two Turtle Doves, and a Partridge in a Pear Tree.\n";
assertEquals(expectedSong, twelveDays.sing());
*/
}
}