Open
Conversation
bchavez
requested changes
Aug 3, 2025
Source/Bogus/Extensions/Australia/ExtensionsForAustraliaRegistrationPlate.cs
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to generate Australian vehicle registration plates with state-specific formats. It includes both the implementation of the feature and corresponding unit tests to ensure correctness. The most important changes are grouped into feature implementation and testing.
Feature Implementation:
AusCarRegistrationPlateinExtensionsForAustraliaRegistrationPlate.csto generate Australian vehicle registration plates based on the state, year, and date range. This method validates the state, determines the registration date, and applies state-specific formatting rules.PlateFormatRuleandStatePlateRulesto encapsulate the logic for state-specific plate formats based on year ranges, including support for custom generation logic.GenerateRegistrationDate,GenerateRegistrationPlate, andGeneratePlateFromFormatto handle random date generation, format selection, and plate string construction.Testing:
AustraliaExtensionTestsinAustraliaExtensionTests.cscontaining unit tests to verify the correctness of theAusCarRegistrationPlatemethod for various states and year ranges.Generates_Correct_Plate_Format_For_State_And_Yearto validate that the generated plate matches the expected format for a given state and year.Generates_Correct_Plate_Format_For_Random_Stateto ensure that the method works correctly when no specific state is provided, generating a valid plate for a random state.