Add regression test for BindingContext.PropertyType (stacked on #8) - #9
Merged
guy-lud merged 1 commit intoJul 12, 2026
Merged
Conversation
Guards the B4 fix (PR #8): BindingContext.PropertyType must expose each property's own type, not its declaring interface. Verified fail-first — with PropertyType = propertyInfo.DeclaringType the assertion reports the property type as the settings interface (ICaptureSettings) instead of System.String. A second test documents that the fix did not remove access to the declaring type: it stays reachable via SettingsType and PropertyInfo.DeclaringType.
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.
Summary
Stacked on top of #8. Adds the regression test for the B4 fix in that PR —
BindingContext.PropertyTypemust expose each property's own type, not its declaring interface.Tests added —
Tests/.../SimpleSettings/BindingContextTests.csA custom
ISectionBindercaptures theBindingContexthanded to it per property.BindPropertySettings_ContextPropertyType_IsThePropertysOwnType— assertscontext.PropertyTypeisstring/int(the property types), not the interface. Fail-first verified: with the fix reverted topropertyInfo.DeclaringType, it reportsICaptureSettingsinstead ofSystem.String.BindPropertySettings_ContextStillExposesDeclaringInterface— documents that the fix did not remove access to the declaring type: it stays reachable viacontext.SettingsTypeandcontext.PropertyInfo.DeclaringType.Verification
dotnet testfromsrc/→ 92 green onnet8.0+net10.0(2 new methods × 2 TFMs on top of #8's 88).