Skip to content
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
89 changes: 46 additions & 43 deletions exercises/practice/bob/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,82 +9,85 @@
# 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"

[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"

[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"
86 changes: 45 additions & 41 deletions exercises/practice/bob/BobResponse.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@ BeforeAll {

Describe "Test Get-BobResponse" {

It "stating something" {
Get-BobResponse -HeyBob "Tom-ay-to, tom-aaaah-to." | Should -BeExactly "Whatever."
It "asking a question" {
Get-BobResponse -HeyBob "Does this cryogenic chamber make me look fat?" | Should -BeExactly "Sure."
}

It "shouting" {
Get-BobResponse -HeyBob "WATCH OUT!" | Should -BeExactly "Whoa, chill out!"
}

It "shouting gibberish" {
Get-BobResponse -HeyBob "FCECDFCAAB" | Should -BeExactly "Whoa, chill out!"
It "forceful question" {
Get-BobResponse -HeyBob "WHAT'S GOING ON?" | Should -BeExactly "Calm down, I know what I'm doing!"
}

It "asking a question" {
Get-BobResponse -HeyBob "Does this cryogenic chamber make me look fat?" | Should -BeExactly "Sure."
It "silence" {
Get-BobResponse -HeyBob "" | Should -BeExactly "Fine. Be that way!"
}

It "stating something" {
Get-BobResponse -HeyBob "Tom-ay-to, tom-aaaah-to." | Should -BeExactly "Whatever."
}

It "asking a numeric question" {
Expand All @@ -28,78 +32,78 @@ Describe "Test Get-BobResponse" {
Get-BobResponse -HeyBob "fffbbcbeab?" | Should -BeExactly "Sure."
}

It "talking forcefully" {
Get-BobResponse -HeyBob "Let's go make out behind the gym!" | Should -BeExactly "Whatever."
It "question with no letters" {
Get-BobResponse -HeyBob "4?" | Should -BeExactly "Sure."
}

It "using acronyms in regular speech" {
Get-BobResponse -HeyBob "It's OK if you don't want to go to the DMV." | Should -BeExactly "Whatever."
It "non-letters with question" {
Get-BobResponse -HeyBob ":) ?" | Should -BeExactly "Sure."
}

It "forceful question" {
Get-BobResponse -HeyBob "WHAT THE HELL WERE YOU THINKING?" | Should -BeExactly "Calm down, I know what I'm doing!"
It "prattling on" {
Get-BobResponse -HeyBob "Wait! Hang on. Are you going to be OK?" | Should -BeExactly "Sure."
}

It "shouting numbers" {
Get-BobResponse -HeyBob "1, 2, 3 GO!" | Should -BeExactly "Whoa, chill out!"
It "ending with whitespace" {
Get-BobResponse -HeyBob "Okay if like my spacebar quite a bit? " | Should -BeExactly "Sure."
}

It "no letters" {
Get-BobResponse -HeyBob "1, 2, 3" | Should -BeExactly "Whatever."
It "multiple line question" {
Get-BobResponse -HeyBob "`nDoes this cryogenic chamber make`n me look fat?" | Should -BeExactly "Sure."
}

It "question with no letters" {
Get-BobResponse -HeyBob "4?" | Should -BeExactly "Sure."
It "shouting gibberish" {
Get-BobResponse -HeyBob "FCECDFCAAB" | Should -BeExactly "Whoa, chill out!"
}

It "shouting a statement containing a question mark" {
Get-BobResponse -HeyBob "DO LIONS EAT PEOPLE? AHHHHH." | Should -BeExactly "Whoa, chill out!"
}

It "shouting numbers" {
Get-BobResponse -HeyBob "1, 2, 3 GO!" | Should -BeExactly "Whoa, chill out!"
}

It "shouting with special characters" {
Get-BobResponse -HeyBob "ZOMG THE %^*@#`$(*^ ZOMBIES ARE COMING!!11!!1!" | Should -BeExactly "Whoa, chill out!"
}

It "shouting with no exclamation mark" {
Get-BobResponse -HeyBob "I HATE YOU" | Should -BeExactly "Whoa, chill out!"
Get-BobResponse -HeyBob "I HATE THE DENTIST" | Should -BeExactly "Whoa, chill out!"
}

It "statement containing question mark" {
Get-BobResponse -HeyBob "Ending with ? means a question." | Should -BeExactly "Whatever."
It "prolonged silence" {
Get-BobResponse -HeyBob " " | Should -BeExactly "Fine. Be that way!"
}

It "non-letters with question" {
Get-BobResponse -HeyBob ":) ?" | Should -BeExactly "Sure."
It "alternate silence" {
Get-BobResponse -HeyBob "`t`t`t`t`t`t`t`t`t`t`t" | Should -BeExactly "Fine. Be that way!"
}

It "prattling on" {
Get-BobResponse -HeyBob "Wait! Hang on. Are you going to be OK?" | Should -BeExactly "Sure."
It "other whitespace" {
Get-BobResponse -HeyBob "`n`r `t" | Should -BeExactly "Fine. Be that way!"
}

It "silence" {
Get-BobResponse -HeyBob "" | Should -BeExactly "Fine. Be that way!"
It "talking forcefully" {
Get-BobResponse -HeyBob "Hi there!" | Should -BeExactly "Whatever."
}

It "prolonged silence" {
Get-BobResponse -HeyBob " " | Should -BeExactly "Fine. Be that way!"
It "using acronyms in regular speech" {
Get-BobResponse -HeyBob "It's OK if you don't want to go work for NASA." | Should -BeExactly "Whatever."
}

It "alternate silence" {
Get-BobResponse -HeyBob "`t`t`t`t`t`t`t`t`t`t`t" | Should -BeExactly "Fine. Be that way!"
It "no letters" {
Get-BobResponse -HeyBob "1, 2, 3" | Should -BeExactly "Whatever."
}

It "multiple line question" {
Get-BobResponse -HeyBob "`nDoes this cryogenic chamber make`n me look fat?" | Should -BeExactly "Sure."
It "statement containing question mark" {
Get-BobResponse -HeyBob "Ending with ? means a question." | Should -BeExactly "Whatever."
}

It "starting with whitespace" {
Get-BobResponse -HeyBob " hmmmmmmm..." | Should -BeExactly "Whatever."
}

It "ending with whitespace" {
Get-BobResponse -HeyBob "Okay if like my spacebar quite a bit? " | Should -BeExactly "Sure."
}

It "other whitespace" {
Get-BobResponse -HeyBob "`n`r `t" | Should -BeExactly "Fine. Be that way!"
}

It "non-question ending with whitespace" {
Get-BobResponse -HeyBob "This is a statement ending with whitespace " | Should -BeExactly "Whatever."
}
Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/connect/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
26 changes: 26 additions & 0 deletions exercises/practice/connect/Connect.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,32 @@ Describe "Connect test cases" {
$got | Should -BeExactly $want
}

It "X wins with left-hand dead end fork" {
$board = @(
". . X .",
" X X . .",
" . X X X",
" O O O O"
)
$got = [Connect]::new($board).GetWinner()
$want = [Winner]::X

$got | Should -BeExactly $want
}

It "X wins with right-hand dead end fork" {
$board = @(
". . X X",
" X X . .",
" . X X .",
" O O O O"
)
$got = [Connect]::new($board).GetWinner()
$want = [Winner]::X

$got | Should -BeExactly $want
}

It "X wins crossing from left to right" {
$board = @(
". O . .",
Expand Down
3 changes: 3 additions & 0 deletions exercises/practice/flower-field/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ description = "cross"

[dd9d4ca8-9e68-4f78-a677-a2a70fd7a7b8]
description = "large garden"

[6e4ac13a-3e43-4728-a2e3-3551d4b1a996]
description = "multiple adjacent flowers"
11 changes: 11 additions & 0 deletions exercises/practice/flower-field/FlowerField.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,17 @@ Describe "Flower Field test cases" {
$got | Should -BeExactly $want
}

It "multiple adjacent flowers" {
$got = Get-Annotate -Garden @(
" ** "
)
$want = @(
"1**1"
)

$got | Should -BeExactly $want
}

It "annotate 9" {
$got = Get-Annotate -Garden @(
" ",
Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/isbn-verifier/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ description = "invalid character in isbn is not treated as zero"
[28025280-2c39-4092-9719-f3234b89c627]
description = "X is only valid as a check digit"

[8005b57f-f194-44ee-88d2-a77ac4142591]
description = "only one check digit is allowed"

[fdb14c99-4cf8-43c5-b06d-eb1638eff343]
description = "X is not substituted by the value 10"

[f6294e61-7e79-46b3-977b-f48789a4945b]
description = "valid isbn without separating dashes"

Expand Down
12 changes: 12 additions & 0 deletions exercises/practice/isbn-verifier/IsbnVerifier.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ Describe "IsbnVerifierTests" {
$got | Should -BeFalse
}

It "only one check digit is allowed" {
$got = Test-Isbn -Isbn "3-598-21508-96"

$got | Should -BeFalse
}

It "X is not substituted by the value 10" {
$got = Test-Isbn -Isbn "3-598-2X507-5"

$got | Should -BeFalse
}

It "valid isbn without separating dashes" {
$got = Test-Isbn -Isbn "3598215088"

Expand Down
Loading