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

Remove obsolete IsValid methods #84

Merged
merged 2 commits into from
Jan 1, 2025
Merged

Conversation

shinji-san
Copy link
Owner

This pull request includes several changes to the Luhn class and its associated tests. The most significant changes involve the removal of obsolete IsValid methods and the introduction of the ValidateAndTrimNumber method for better validation. Additionally, the AsciiCodeForZero constant has been added for improved code readability.

Changes to Luhn class:

  • Removed obsolete IsValid methods and replaced their usage with IsValidLuhnNumber and IsValidLuhnCheckDigit methods. [1] [2] [3] [4] [5]
  • Introduced the ValidateAndTrimNumber method to replace IsNumber for better validation and trimming of input numbers. [1] [2]
  • Added AsciiCodeForZero constant to improve code readability in digit extraction methods. [1] [2] [3]
  • Updated ComputeLuhnCheckDigit and IsValidLuhnNumber methods to use ValidateAndTrimNumber for input validation. [1] [2] [3] [4]

Changes to tests:

  • Removed references to obsolete IsValid methods in test cases and replaced them with IsValidLuhnNumber and IsValidLuhnCheckDigit methods. [1] [2] [3] [4] [5] [6]

Documentation:

  • Updated CHANGELOG.md to reflect the removal of Luhn.IsValid methods.

Deprecated `Luhn.IsValid` methods have been removed from the codebase, including tests and spanning overloads.
Users should now migrate to the updated `IsValidLuhnNumber` and `IsValidLuhnCheckDigit` methods for validation tasks.
Updates are reflected in the changelog for clarity.

Resolves: No entry
Replaced `IsNumber` with `ValidateAndTrimNumber` to improve readability and better communicate its purpose.
Introduced `AsciiCodeForZero` constant for cleaner ASCII code calculations.
Updated method references and comments to reflect these changes, enhancing maintainability.

Resolves: No entry
@shinji-san shinji-san self-assigned this Jan 1, 2025
@shinji-san shinji-san merged commit 52547f7 into develop Jan 1, 2025
3 checks passed
@shinji-san shinji-san deleted the remove-ObsoleteIsValidMethods branch January 1, 2025 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant