From 2727382f56663760745d46b9ed32072470f40536 Mon Sep 17 00:00:00 2001 From: Manuel Maxera <95315128+manumafe98@users.noreply.github.com> Date: Fri, 29 Dec 2023 16:07:14 -0300 Subject: [PATCH] Sync tests for practice exercise say (#2611) --- exercises/practice/say/.meta/tests.toml | 67 +++++++++++++++++++ .../practice/say/src/test/java/SayTest.java | 42 +++++++++--- 2 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 exercises/practice/say/.meta/tests.toml diff --git a/exercises/practice/say/.meta/tests.toml b/exercises/practice/say/.meta/tests.toml new file mode 100644 index 000000000..a5532e9ed --- /dev/null +++ b/exercises/practice/say/.meta/tests.toml @@ -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" diff --git a/exercises/practice/say/src/test/java/SayTest.java b/exercises/practice/say/src/test/java/SayTest.java index 1f3cc3404..f5f8d2b27 100644 --- a/exercises/practice/say/src/test/java/SayTest.java +++ b/exercises/practice/say/src/test/java/SayTest.java @@ -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() { @@ -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() { @@ -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() { @@ -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() { @@ -96,5 +120,5 @@ public void illegalNegativeNumber() { @Test(expected = IllegalArgumentException.class) public void illegalTooBigNumber() { say.say(1_000_000_000_000L); - } + } }