Skip to content

test: enhance LazyReflectionConverterTests with serialization and filtering scenarios#58

Merged
IvanMurzak merged 2 commits into
mainfrom
fix/lazy-reflection-converter
Jan 18, 2026
Merged

test: enhance LazyReflectionConverterTests with serialization and filtering scenarios#58
IvanMurzak merged 2 commits into
mainfrom
fix/lazy-reflection-converter

Conversation

@IvanMurzak

@IvanMurzak IvanMurzak commented Jan 18, 2026

Copy link
Copy Markdown
Owner

This pull request refactors the LazyReflectionConverter and its related tests to improve how property and field serialization is delegated and filtered, especially when using a backing converter. The changes ensure that ignored properties and fields are consistently respected, and that the converter works correctly even when a backing converter is present. The test suite is expanded to cover these scenarios and verify correct behavior.

Converter logic improvements

  • Refactored LazyReflectionConverter to delegate property and field serialization to the backing converter when present, using new GetSerializablePropertiesInternal and GetSerializableFieldsInternal overrides, ensuring correct filtering and delegation.
  • Updated logic for collecting ignored properties and fields so that both base and instance-level ignored members are combined, ensuring all relevant members are filtered out during serialization.

Test enhancements

  • Added new tests in LazyReflectionConverterTests to verify that ignored properties are correctly filtered even when a backing converter is used, and that constructing a converter with both a backing converter and ignored members no longer throws exceptions.
  • Updated the test mock converter to track metadata access rather than method calls, aligning with the new delegation approach and ensuring assertions check for correct metadata access.

Minor code maintenance

  • Adjusted the order of property filtering in BaseReflectionConverter to ensure obsolete properties are filtered after checking readability, improving clarity and correctness.
  • Cleaned up unused imports in LazyReflectionConverter.cs.
  • Simplified internal access to the target type by removing an unnecessary method.

@IvanMurzak IvanMurzak self-assigned this Jan 18, 2026
@IvanMurzak IvanMurzak added the bug Something isn't working label Jan 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    2 files      2 suites   8m 23s ⏱️
1 155 tests 1 155 ✅ 0 💤 0 ❌
2 310 runs  2 310 ✅ 0 💤 0 ❌

Results for commit 064b2c8.

@IvanMurzak IvanMurzak merged commit 14bb137 into main Jan 18, 2026
2 checks passed
@IvanMurzak IvanMurzak deleted the fix/lazy-reflection-converter branch January 18, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant