Make API consistency test methods virtual to allow provider customization #36526
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 change makes the API consistency test methods in
ApiConsistencyTestBasevirtual, allowing database providers to override and customize the validation behavior for their specific needs.Changes Made
Test Methods Made Virtual:
Fluent_api_methods_should_not_return_voidGeneric_fluent_api_methods_should_return_generic_typesBuilders_have_matching_methodsMetadata_types_have_expected_structureMutable_metadata_types_have_matching_methodsConvention_metadata_types_have_matching_methodsConvention_metadata_types_have_expected_methodsConvention_builder_types_have_expected_methodsConvention_builder_methods_have_matching_returnsRuntime_metadata_types_have_matching_methodsReadonly_metadata_methods_have_expected_nameMutable_metadata_methods_have_expected_shapeConvention_metadata_methods_have_expected_shapeHelper Methods Made Protected Virtual:
ValidateConventionBuilderMethodReturnsValidateMetadataValidateConventionMethodsValidateConventionBuilderMethodsValidateMutableMethodValidateConventionMethodMatchMutableMatchConventionMatchRuntimeBenefits
Providers can now customize API consistency validation by overriding specific test methods or helper methods. For example, a provider might need to:
Backward Compatibility
These changes are fully backward compatible. Existing provider tests will continue to work without modification, and providers can optionally override methods as needed.
Fixes #36521.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.