Skip to content

Commit 92a8206

Browse files
authored
Luhn: A new test case with odd number of digits (#1543)
* Luhn: A new test case with odd number of digits A new positive test case with odd number of digits and non-zero first digit. * Update the test file of Luhn problem using problem specification A new positive test case with odd number of digits and non-zero first digit.
1 parent 6601d97 commit 92a8206

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

exercises/practice/luhn/.meta/tests.toml

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
411

512
[792a7082-feb7-48c7-b88b-bbfec160865e]
613
description = "single digit strings can not be valid"
@@ -50,6 +57,9 @@ description = "more than a single zero is valid"
5057
[ab56fa80-5de8-4735-8a4a-14dae588663e]
5158
description = "input digit 9 is correctly converted to output digit 9"
5259

60+
[8a7c0e24-85ea-4154-9cf1-c2db90eabc08]
61+
description = "valid luhn with an odd number of digits and non zero first digit"
62+
5363
[39a06a5a-5bad-4e0f-b215-b042d46209b1]
5464
description = "using ascii value for non-doubled non-digit isn't allowed"
5565

exercises/practice/luhn/LuhnTests.cs

+6
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ public void Input_digit_9_is_correctly_converted_to_output_digit_9()
9898
Assert.True(Luhn.IsValid("091"));
9999
}
100100

101+
[Fact(Skip = "Remove this Skip property to run this test")]
102+
public void Valid_luhn_with_an_odd_number_of_digits_and_non_zero_first_digit()
103+
{
104+
Assert.True(Luhn.IsValid("109"));
105+
}
106+
101107
[Fact(Skip = "Remove this Skip property to run this test")]
102108
public void Using_ascii_value_for_non_doubled_non_digit_isnt_allowed()
103109
{

0 commit comments

Comments
 (0)