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

Sync tests for practice exercise say #2611

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
67 changes: 67 additions & 0 deletions exercises/practice/say/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[5d22a120-ba0c-428c-bd25-8682235d83e8]
description = "zero"

[9b5eed77-dbf6-439d-b920-3f7eb58928f6]
description = "one"

[7c499be1-612e-4096-a5e1-43b2f719406d]
description = "fourteen"

[f541dd8e-f070-4329-92b4-b7ce2fcf06b4]
description = "twenty"

[d78601eb-4a84-4bfa-bf0e-665aeb8abe94]
description = "twenty-two"

[f010d4ca-12c9-44e9-803a-27789841adb1]
description = "thirty"

[738ce12d-ee5c-4dfb-ad26-534753a98327]
description = "ninety-nine"

[e417d452-129e-4056-bd5b-6eb1df334dce]
description = "one hundred"

[d6924f30-80ba-4597-acf6-ea3f16269da8]
description = "one hundred twenty-three"

[2f061132-54bc-4fd4-b5df-0a3b778959b9]
description = "two hundred"

[feed6627-5387-4d38-9692-87c0dbc55c33]
description = "nine hundred ninety-nine"

[3d83da89-a372-46d3-b10d-de0c792432b3]
description = "one thousand"

[865af898-1d5b-495f-8ff0-2f06d3c73709]
description = "one thousand two hundred thirty-four"

[b6a3f442-266e-47a3-835d-7f8a35f6cf7f]
description = "one million"

[2cea9303-e77e-4212-b8ff-c39f1978fc70]
description = "one million two thousand three hundred forty-five"

[3e240eeb-f564-4b80-9421-db123f66a38f]
description = "one billion"

[9a43fed1-c875-4710-8286-5065d73b8a9e]
description = "a big number"

[49a6a17b-084e-423e-994d-a87c0ecc05ef]
description = "numbers below zero are out of range"

[4d6492eb-5853-4d16-9d34-b0f61b261fd9]
description = "numbers above 999,999,999,999 are out of range"
42 changes: 33 additions & 9 deletions exercises/practice/say/src/test/java/SayTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
public class SayTest {

private Say say = new Say();

@Test
public void zero() {
assertThat(say.say(0)).isEqualTo("zero");
}

@Ignore("Remove to run test")
@Test
public void one() {
Expand All @@ -36,6 +36,18 @@ public void twentyTwo() {
assertThat(say.say(22)).isEqualTo("twenty-two");
}

@Ignore("Remove to run test")
@Test
public void thirty() {
assertThat(say.say(30)).isEqualTo("thirty");
}

@Ignore("Remove to run test")
@Test
public void ninetyNine() {
assertThat(say.say(99)).isEqualTo("ninety-nine");
}

@Ignore("Remove to run test")
@Test
public void oneHundred() {
Expand All @@ -48,6 +60,18 @@ public void oneHundredTwentyThree() {
assertThat(say.say(123)).isEqualTo("one hundred twenty-three");
}

@Ignore("Remove to run test")
@Test
public void twoHundred() {
assertThat(say.say(200)).isEqualTo("two hundred");
}

@Ignore("Remove to run test")
@Test
public void nineHundredNinetyNine() {
assertThat(say.say(999)).isEqualTo("nine hundred ninety-nine");
}

@Ignore("Remove to run test")
@Test
public void oneThousand() {
Expand All @@ -65,27 +89,27 @@ public void oneThousandTwoHundredThirtyFour() {
public void oneMillion() {
assertThat(say.say(1_000_000)).isEqualTo("one million");
}

@Ignore("Remove to run test")
@Test
public void oneMillionTwoThousandThreeHundredFortyFive() {
assertThat(say.say(1_002_345)).isEqualTo("one million two thousand three hundred forty-five");
}

@Ignore("Remove to run test")
@Test
public void oneBillion() {
assertThat(say.say(1_000_000_000)).isEqualTo("one billion");
}

@Ignore("Remove to run test")
@Test
public void nineHundredEightySevenBillionSixHundredFiftyFourThreeHundredTwentyOneThousandOneHundredTwentyThree() {
assertThat(say.say(987_654_321_123L))
.isEqualTo("nine hundred eighty-seven billion six hundred fifty-four million" +
" three hundred twenty-one thousand one hundred twenty-three");
.isEqualTo("nine hundred eighty-seven billion six hundred fifty-four million" +
" three hundred twenty-one thousand one hundred twenty-three");
}

@Ignore("Remove to run test")
@Test(expected = IllegalArgumentException.class)
public void illegalNegativeNumber() {
Expand All @@ -96,5 +120,5 @@ public void illegalNegativeNumber() {
@Test(expected = IllegalArgumentException.class)
public void illegalTooBigNumber() {
say.say(1_000_000_000_000L);
}
}
}