Make all test methods virtual in VectorData.ConformanceTests - #7606
Merged
Conversation
Add the `virtual` modifier to all test methods (marked with [Fact], [Theory], etc.) in Microsoft.Extensions.VectorData.ConformanceTests that were missing it, so derived types can customize behavior.
Copilot created this pull request from a session on behalf of
adamsitnik
July 2, 2026 08:34
View session
adamsitnik
marked this pull request as ready for review
July 2, 2026 08:43
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the VectorData conformance test base classes to make all xUnit test methods virtual, enabling providers to override test behavior in derived implementations.
Changes:
- Marked
[Fact]methods asvirtualinCollectionManagementTestsandHybridSearchTests. - Marked additional
[Fact]/[Theory]methods asvirtualinDependencyInjectionTests. - Marked
Delete_single_recordasvirtualinModelTests/DynamicModelTests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/CollectionManagementTests.cs | Makes collection-management [Fact] tests virtual for provider overrides. |
| src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/DependencyInjectionTests.cs | Makes DI-focused [Fact]/[Theory] tests virtual for provider overrides. |
| src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/HybridSearchTests.cs | Makes hybrid-search [Fact] tests virtual for provider overrides. |
| src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/DynamicModelTests.cs | Makes a dynamic-model delete [Fact] test virtual for provider overrides. |
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
roji
approved these changes
Jul 2, 2026
Collaborator
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1491357&view=codecoverage-tab |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Conformance test base classes should have all test methods marked
virtualso providers can override behavior in derived types. Several methods were missing the modifier.Changes
virtualto test methods in:CollectionManagementTests.cs(6 methods)DependencyInjectionTests.cs(2 methods)HybridSearchTests.cs(7 methods)ModelTests/DynamicModelTests.cs(1 method)All other test files already had
virtualon their test methods.Before/After