From ca00c788b7a3b0c288cf208f07b9a44fa8522ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20B=20Nagy?= <20251272+BNAndras@users.noreply.github.com> Date: Sun, 30 Aug 2026 21:57:22 -0700 Subject: [PATCH] Sync new tests --- exercises/practice/bob/.meta/tests.toml | 89 +++++++++---------- exercises/practice/bob/BobTests.cs | 94 +++++++++++---------- exercises/practice/connect/.meta/tests.toml | 6 ++ exercises/practice/connect/ConnectTests.cs | 30 ++++++- exercises/practice/line-up/.meta/tests.toml | 18 ++++ exercises/practice/line-up/LineUpTests.cs | 42 +++++++++ 6 files changed, 190 insertions(+), 89 deletions(-) diff --git a/exercises/practice/bob/.meta/tests.toml b/exercises/practice/bob/.meta/tests.toml index 5299e2895f..c6a4649601 100644 --- a/exercises/practice/bob/.meta/tests.toml +++ b/exercises/practice/bob/.meta/tests.toml @@ -9,17 +9,20 @@ # As user-added comments (using the # character) will be removed when this file # is regenerated, comments can be added via a `comment` key. -[e162fead-606f-437a-a166-d051915cea8e] -description = "stating something" +[8a2e771d-d6f1-4e3f-b6c6-b41495556e37] +description = "asking a question" [73a966dc-8017-47d6-bb32-cf07d1a5fcd9] description = "shouting" -[d6c98afd-df35-4806-b55e-2c457c3ab748] -description = "shouting gibberish" +[a5193c61-4a92-4f68-93e2-f554eb385ec6] +description = "forceful question" -[8a2e771d-d6f1-4e3f-b6c6-b41495556e37] -description = "asking a question" +[bc39f7c6-f543-41be-9a43-fd1c2f753fc0] +description = "silence" + +[e162fead-606f-437a-a166-d051915cea8e] +description = "stating something" [81080c62-4e4d-4066-b30a-48d8d76920d9] description = "asking a numeric question" @@ -27,23 +30,34 @@ description = "asking a numeric question" [2a02716d-685b-4e2e-a804-2adaf281c01e] description = "asking gibberish" -[c02f9179-ab16-4aa7-a8dc-940145c385f7] -description = "talking forcefully" +[bb0011c5-cd52-4a5b-8bfb-a87b6283b0e2] +description = "question with no letters" -[153c0e25-9bb5-4ec5-966e-598463658bcd] -description = "using acronyms in regular speech" +[9bfc677d-ea3a-45f2-be44-35bc8fa3753e] +description = "non-letters with question" -[a5193c61-4a92-4f68-93e2-f554eb385ec6] -description = "forceful question" +[8608c508-f7de-4b17-985b-811878b3cf45] +description = "prattling on" -[a20e0c54-2224-4dde-8b10-bd2cdd4f61bc] -description = "shouting numbers" +[05b304d6-f83b-46e7-81e0-4cd3ca647900] +description = "ending with whitespace" -[f7bc4b92-bdff-421e-a238-ae97f230ccac] -description = "no letters" +[66953780-165b-4e7e-8ce3-4bcb80b6385a] +description = "multiple line question" +include = false -[bb0011c5-cd52-4a5b-8bfb-a87b6283b0e2] -description = "question with no letters" +[2c7278ac-f955-4eb4-bf8f-e33eb4116a15] +description = "multiple line question" +reimplements = "66953780-165b-4e7e-8ce3-4bcb80b6385a" + +[d6c98afd-df35-4806-b55e-2c457c3ab748] +description = "shouting gibberish" + +[3c954328-86fb-4c71-8961-e18d6a5e2517] +description = "shouting a statement containing a question mark" + +[a20e0c54-2224-4dde-8b10-bd2cdd4f61bc] +description = "shouting numbers" [496143c8-1c31-4c01-8a08-88427af85c66] description = "shouting with special characters" @@ -51,40 +65,29 @@ description = "shouting with special characters" [e6793c1c-43bd-4b8d-bc11-499aea73925f] description = "shouting with no exclamation mark" -[aa8097cc-c548-4951-8856-14a404dd236a] -description = "statement containing question mark" - -[9bfc677d-ea3a-45f2-be44-35bc8fa3753e] -description = "non-letters with question" - -[8608c508-f7de-4b17-985b-811878b3cf45] -description = "prattling on" - -[bc39f7c6-f543-41be-9a43-fd1c2f753fc0] -description = "silence" - [d6c47565-372b-4b09-b1dd-c40552b8378b] description = "prolonged silence" [4428f28d-4100-4d85-a902-e5a78cb0ecd3] description = "alternate silence" -[66953780-165b-4e7e-8ce3-4bcb80b6385a] -description = "multiple line question" -include = false +[72bd5ad3-9b2f-4931-a988-dce1f5771de2] +description = "other whitespace" -[5371ef75-d9ea-4103-bcfa-2da973ddec1b] -description = "starting with whitespace" +[c02f9179-ab16-4aa7-a8dc-940145c385f7] +description = "talking forcefully" -[05b304d6-f83b-46e7-81e0-4cd3ca647900] -description = "ending with whitespace" +[153c0e25-9bb5-4ec5-966e-598463658bcd] +description = "using acronyms in regular speech" -[72bd5ad3-9b2f-4931-a988-dce1f5771de2] -description = "other whitespace" +[f7bc4b92-bdff-421e-a238-ae97f230ccac] +description = "no letters" + +[aa8097cc-c548-4951-8856-14a404dd236a] +description = "statement containing question mark" + +[5371ef75-d9ea-4103-bcfa-2da973ddec1b] +description = "starting with whitespace" [12983553-8601-46a8-92fa-fcaa3bc4a2a0] description = "non-question ending with whitespace" - -[2c7278ac-f955-4eb4-bf8f-e33eb4116a15] -description = "multiple line question" -reimplements = "66953780-165b-4e7e-8ce3-4bcb80b6385a" diff --git a/exercises/practice/bob/BobTests.cs b/exercises/practice/bob/BobTests.cs index 211f9d33bd..53ad2ec542 100644 --- a/exercises/practice/bob/BobTests.cs +++ b/exercises/practice/bob/BobTests.cs @@ -1,9 +1,9 @@ public class BobTests { [Fact] - public void Stating_something() + public void Asking_a_question() { - Assert.Equal("Whatever.", Bob.Response("Tom-ay-to, tom-aaaah-to.")); + Assert.Equal("Sure.", Bob.Response("Does this cryogenic chamber make me look fat?")); } [Fact(Skip = "Remove this Skip property to run this test")] @@ -13,15 +13,21 @@ public void Shouting() } [Fact(Skip = "Remove this Skip property to run this test")] - public void Shouting_gibberish() + public void Forceful_question() { - Assert.Equal("Whoa, chill out!", Bob.Response("FCECDFCAAB")); + Assert.Equal("Calm down, I know what I'm doing!", Bob.Response("WHAT'S GOING ON?")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Asking_a_question() + public void Silence() { - Assert.Equal("Sure.", Bob.Response("Does this cryogenic chamber make me look fat?")); + Assert.Equal("Fine. Be that way!", Bob.Response("")); + } + + [Fact(Skip = "Remove this Skip property to run this test")] + public void Stating_something() + { + Assert.Equal("Whatever.", Bob.Response("Tom-ay-to, tom-aaaah-to.")); } [Fact(Skip = "Remove this Skip property to run this test")] @@ -37,116 +43,116 @@ public void Asking_gibberish() } [Fact(Skip = "Remove this Skip property to run this test")] - public void Talking_forcefully() + public void Question_with_no_letters() { - Assert.Equal("Whatever.", Bob.Response("Hi there!")); + Assert.Equal("Sure.", Bob.Response("4?")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Using_acronyms_in_regular_speech() + public void Non_letters_with_question() { - Assert.Equal("Whatever.", Bob.Response("It's OK if you don't want to go work for NASA.")); + Assert.Equal("Sure.", Bob.Response(":) ?")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Forceful_question() + public void Prattling_on() { - Assert.Equal("Calm down, I know what I'm doing!", Bob.Response("WHAT'S GOING ON?")); + Assert.Equal("Sure.", Bob.Response("Wait! Hang on. Are you going to be OK?")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Shouting_numbers() + public void Ending_with_whitespace() { - Assert.Equal("Whoa, chill out!", Bob.Response("1, 2, 3 GO!")); + Assert.Equal("Sure.", Bob.Response("Okay if like my spacebar quite a bit? ")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void No_letters() + public void Multiple_line_question() { - Assert.Equal("Whatever.", Bob.Response("1, 2, 3")); + Assert.Equal("Sure.", Bob.Response("\nDoes this cryogenic chamber make\n me look fat?")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Question_with_no_letters() + public void Shouting_gibberish() { - Assert.Equal("Sure.", Bob.Response("4?")); + Assert.Equal("Whoa, chill out!", Bob.Response("FCECDFCAAB")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Shouting_with_special_characters() + public void Shouting_a_statement_containing_a_question_mark() { - Assert.Equal("Whoa, chill out!", Bob.Response("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!")); + Assert.Equal("Whoa, chill out!", Bob.Response("DO LIONS EAT PEOPLE? AHHHHH.")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Shouting_with_no_exclamation_mark() + public void Shouting_numbers() { - Assert.Equal("Whoa, chill out!", Bob.Response("I HATE THE DENTIST")); + Assert.Equal("Whoa, chill out!", Bob.Response("1, 2, 3 GO!")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Statement_containing_question_mark() + public void Shouting_with_special_characters() { - Assert.Equal("Whatever.", Bob.Response("Ending with ? means a question.")); + Assert.Equal("Whoa, chill out!", Bob.Response("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Non_letters_with_question() + public void Shouting_with_no_exclamation_mark() { - Assert.Equal("Sure.", Bob.Response(":) ?")); + Assert.Equal("Whoa, chill out!", Bob.Response("I HATE THE DENTIST")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Prattling_on() + public void Prolonged_silence() { - Assert.Equal("Sure.", Bob.Response("Wait! Hang on. Are you going to be OK?")); + Assert.Equal("Fine. Be that way!", Bob.Response(" ")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Silence() + public void Alternate_silence() { - Assert.Equal("Fine. Be that way!", Bob.Response("")); + Assert.Equal("Fine. Be that way!", Bob.Response("\t\t\t\t\t\t\t\t\t\t")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Prolonged_silence() + public void Other_whitespace() { - Assert.Equal("Fine. Be that way!", Bob.Response(" ")); + Assert.Equal("Fine. Be that way!", Bob.Response("\n\r \t")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Alternate_silence() + public void Talking_forcefully() { - Assert.Equal("Fine. Be that way!", Bob.Response("\t\t\t\t\t\t\t\t\t\t")); + Assert.Equal("Whatever.", Bob.Response("Hi there!")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Starting_with_whitespace() + public void Using_acronyms_in_regular_speech() { - Assert.Equal("Whatever.", Bob.Response(" hmmmmmmm...")); + Assert.Equal("Whatever.", Bob.Response("It's OK if you don't want to go work for NASA.")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Ending_with_whitespace() + public void No_letters() { - Assert.Equal("Sure.", Bob.Response("Okay if like my spacebar quite a bit? ")); + Assert.Equal("Whatever.", Bob.Response("1, 2, 3")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Other_whitespace() + public void Statement_containing_question_mark() { - Assert.Equal("Fine. Be that way!", Bob.Response("\n\r \t")); + Assert.Equal("Whatever.", Bob.Response("Ending with ? means a question.")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Non_question_ending_with_whitespace() + public void Starting_with_whitespace() { - Assert.Equal("Whatever.", Bob.Response("This is a statement ending with whitespace ")); + Assert.Equal("Whatever.", Bob.Response(" hmmmmmmm...")); } [Fact(Skip = "Remove this Skip property to run this test")] - public void Multiple_line_question() + public void Non_question_ending_with_whitespace() { - Assert.Equal("Sure.", Bob.Response("\nDoes this cryogenic chamber make\n me look fat?")); + Assert.Equal("Whatever.", Bob.Response("This is a statement ending with whitespace ")); } } diff --git a/exercises/practice/connect/.meta/tests.toml b/exercises/practice/connect/.meta/tests.toml index 6ada87732c..951b87e5c4 100644 --- a/exercises/practice/connect/.meta/tests.toml +++ b/exercises/practice/connect/.meta/tests.toml @@ -30,6 +30,12 @@ description = "nobody wins crossing adjacent angles" [cd61c143-92f6-4a8d-84d9-cb2b359e226b] description = "X wins crossing from left to right" +[495e33ed-30a9-4012-b46e-d7c4d5fe13c3] +description = "X wins with left-hand dead end fork" + +[ab167ab0-4a98-4d0f-a1c0-e1cddddc3d58] +description = "X wins with right-hand dead end fork" + [73d1eda6-16ab-4460-9904-b5f5dd401d0b] description = "O wins crossing from top to bottom" diff --git a/exercises/practice/connect/ConnectTests.cs b/exercises/practice/connect/ConnectTests.cs index f96f96f3f5..59c094300e 100644 --- a/exercises/practice/connect/ConnectTests.cs +++ b/exercises/practice/connect/ConnectTests.cs @@ -15,7 +15,7 @@ public void An_empty_board_has_no_winner() } [Fact(Skip = "Remove this Skip property to run this test")] - public void X_can_win_on_a_1x1_board() + public void X_can_win_on_a_1x_1_board() { string[] board = [ "X" @@ -25,7 +25,7 @@ public void X_can_win_on_a_1x1_board() } [Fact(Skip = "Remove this Skip property to run this test")] - public void O_can_win_on_a_1x1_board() + public void O_can_win_on_a_1x_1_board() { string[] board = [ "O" @@ -89,6 +89,32 @@ public void X_wins_crossing_from_left_to_right() Assert.Equal(ConnectWinner.Black, sut.Result()); } + [Fact(Skip = "Remove this Skip property to run this test")] + public void X_wins_with_left_hand_dead_end_fork() + { + string[] board = [ + ". . X .", + " X X . .", + " . X X X", + " O O O O" + ]; + var sut = new Connect(board); + Assert.Equal(ConnectWinner.Black, sut.Result()); + } + + [Fact(Skip = "Remove this Skip property to run this test")] + public void X_wins_with_right_hand_dead_end_fork() + { + string[] board = [ + ". . X X", + " X X . .", + " . X X .", + " O O O O" + ]; + var sut = new Connect(board); + Assert.Equal(ConnectWinner.Black, sut.Result()); + } + [Fact(Skip = "Remove this Skip property to run this test")] public void O_wins_crossing_from_top_to_bottom() { diff --git a/exercises/practice/line-up/.meta/tests.toml b/exercises/practice/line-up/.meta/tests.toml index 36fdf1d0cd..dd66fc1585 100644 --- a/exercises/practice/line-up/.meta/tests.toml +++ b/exercises/practice/line-up/.meta/tests.toml @@ -51,9 +51,24 @@ description = "format non-exceptional ordinal numeral 13" [2bdcebc5-c029-4874-b6cc-e9bec80d603a] description = "format exceptional ordinal numeral 21" +[a98e2e22-ab41-4557-a7c2-efedc19c16da] +description = "format exceptional ordinal numeral 22 ending in nd even though it is a multiple of 11" + +[ab45d2fb-e0ee-4016-b605-76917584db0a] +description = "format exceptional ordinal numeral 33 ending in rd even though it is a multiple of 11" + +[c9243603-9f17-45b3-9a41-db9ebdbf08e1] +description = "format exceptional ordinal numeral 52 ending in nd even though it is a multiple of 13" + [74ee2317-0295-49d2-baf0-d56bcefa14e3] description = "format exceptional ordinal numeral 62" +[3f6c408c-4331-42b6-bb6c-3ad0823e568a] +description = "format non-exceptional ordinal numeral 72 ending in nd even though it is a multiple of 12" + +[8db52cd9-9689-413f-a812-6c36fcfd0d07] +description = "format exceptional ordinal numeral 91 ending in st even though it is a multiple of 13" + [b37c332d-7f68-40e3-8503-e43cbd67a0c4] description = "format exceptional ordinal numeral 100" @@ -65,3 +80,6 @@ description = "format non-exceptional ordinal numeral 112" [06b62efe-199e-4ce7-970d-4bf73945713f] description = "format exceptional ordinal numeral 123" + +[6792c54e-59a7-4faf-839a-c4bb61014229] +description = "format large number 972 ending in nd even though it is a multiple of 12" diff --git a/exercises/practice/line-up/LineUpTests.cs b/exercises/practice/line-up/LineUpTests.cs index f19c138e7d..284d611bbe 100644 --- a/exercises/practice/line-up/LineUpTests.cs +++ b/exercises/practice/line-up/LineUpTests.cs @@ -98,6 +98,27 @@ public void Format_exceptional_ordinal_numeral_21() Assert.Equal(expected, LineUp.Format("Washi", 21)); } + [Fact(Skip = "Remove this Skip property to run this test")] + public void Format_exceptional_ordinal_numeral_22_ending_in_nd_even_though_it_is_a_multiple_of_11() + { + string expected = "Ingrid, you are the 22nd customer we serve today. Thank you!"; + Assert.Equal(expected, LineUp.Format("Ingrid", 22)); + } + + [Fact(Skip = "Remove this Skip property to run this test")] + public void Format_exceptional_ordinal_numeral_33_ending_in_rd_even_though_it_is_a_multiple_of_11() + { + string expected = "Mario, you are the 33rd customer we serve today. Thank you!"; + Assert.Equal(expected, LineUp.Format("Mario", 33)); + } + + [Fact(Skip = "Remove this Skip property to run this test")] + public void Format_exceptional_ordinal_numeral_52_ending_in_nd_even_though_it_is_a_multiple_of_13() + { + string expected = "Quentin, you are the 52nd customer we serve today. Thank you!"; + Assert.Equal(expected, LineUp.Format("Quentin", 52)); + } + [Fact(Skip = "Remove this Skip property to run this test")] public void Format_exceptional_ordinal_numeral_62() { @@ -105,6 +126,20 @@ public void Format_exceptional_ordinal_numeral_62() Assert.Equal(expected, LineUp.Format("Nayra", 62)); } + [Fact(Skip = "Remove this Skip property to run this test")] + public void Format_non_exceptional_ordinal_numeral_72_ending_in_nd_even_though_it_is_a_multiple_of_12() + { + string expected = "Ugo, you are the 72nd customer we serve today. Thank you!"; + Assert.Equal(expected, LineUp.Format("Ugo", 72)); + } + + [Fact(Skip = "Remove this Skip property to run this test")] + public void Format_exceptional_ordinal_numeral_91_ending_in_st_even_though_it_is_a_multiple_of_13() + { + string expected = "Boris, you are the 91st customer we serve today. Thank you!"; + Assert.Equal(expected, LineUp.Format("Boris", 91)); + } + [Fact(Skip = "Remove this Skip property to run this test")] public void Format_exceptional_ordinal_numeral_100() { @@ -132,4 +167,11 @@ public void Format_exceptional_ordinal_numeral_123() string expected = "Yma, you are the 123rd customer we serve today. Thank you!"; Assert.Equal(expected, LineUp.Format("Yma", 123)); } + + [Fact(Skip = "Remove this Skip property to run this test")] + public void Format_large_number_972_ending_in_nd_even_though_it_is_a_multiple_of_12() + { + string expected = "Elias, you are the 972nd customer we serve today. Thank you!"; + Assert.Equal(expected, LineUp.Format("Elias", 972)); + } }