Skip to content

Conversation

@glennawatson
Copy link
Contributor

This pull request adds comprehensive new unit tests across several test projects to improve coverage and reliability for ReactiveUI's builder mixins, generic host controls, and testing utilities. The new tests ensure correct registration, property behavior, and exception handling for various components, as well as robust test isolation and MessageBus override mechanisms.

@codecov
Copy link

codecov bot commented Jan 18, 2026

Codecov Report

❌ Patch coverage is 94.81481% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.43%. Comparing base (68903f2) to head (ecbe80f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...erty/Internal/PropertyBindingExpressionCompiler.cs 93.54% 3 Missing and 7 partials ⚠️
...ings/Property/Internal/BindingConverterResolver.cs 96.42% 2 Missing ⚠️
...c/ReactiveUI.Maui/ViewModelViewHost{TViewModel}.cs 0.00% 1 Missing ⚠️
.../Bindings/Property/PropertyBinderImplementation.cs 95.83% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4272       +/-   ##
===========================================
+ Coverage   78.70%   89.43%   +10.73%     
===========================================
  Files         248      251        +3     
  Lines        9552     9564       +12     
  Branches     1459     1456        -3     
===========================================
+ Hits         7518     8554     +1036     
+ Misses       1792      771     -1021     
+ Partials      242      239        -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Implemented tests for StringToBooleanTypeConverter, StringToDateOnlyTypeConverter, StringToDateTimeOffsetTypeConverter, StringToDateTimeTypeConverter, StringToGuidTypeConverter, StringToNullableBooleanTypeConverter, StringToNullableDateOnlyTypeConverter, StringToNullableDateTimeOffsetTypeConverter, StringToNullableDateTimeTypeConverter, StringToNullableGuidTypeConverter, StringToNullableTimeOnlyTypeConverter, StringToNullableTimeSpanTypeConverter, StringToTimeOnlyTypeConverter, StringToTimeSpanTypeConverter, StringToUriTypeConverter, TimeOnlyToStringTypeConverter, TimeSpanToStringTypeConverter, and UriToStringTypeConverter.
- Each test class includes tests for affinity and conversion success for valid inputs, as well as handling of null, empty, and invalid strings.
- Ensured compatibility with .NET 6.0 or greater where applicable.
…ents

Refactors PropertyBinderImplementation (1,170 lines -> 709 lines, 39% reduction) by extracting three internal service interfaces with implementations and mock support.

Changes:
- Extract IBindingConverterResolver: Type converter resolution with RxConverters/Splat fallback
- Extract IPropertyBindingExpressionCompiler: Expression analysis, compilation, and observable creation
- Extract IBindingHookEvaluator: Pre-binding validation via registered hooks
- Add internal constructor for dependency injection (enables testing)
- Maintain public parameterless constructor for backward compatibility
- Create mock implementations (MockBindingConverterResolver, MockPropertyBindingExpressionCompiler, MockBindingHookEvaluator)
- Add 17 focused unit tests covering all three services

Benefits:
- Improved testability: Services can be mocked without global Splat state manipulation
- Better separation of concerns: Each service has single responsibility
- Maintained backward compatibility: No public API changes
- All 4,929 tests pass (51 new unit tests added)
- StyleCop compliant: Build succeeds with -warnaserror
…erRegistrar

- Introduced BindingTypeConverterTests to validate conversion logic for various types including string to int, nullable handling, and type mismatches.
- Enhanced StringToByteTypeConverterTests, StringToDecimalTypeConverterTests, StringToDoubleTypeConverterTests, StringToIntegerTypeConverterTests, StringToLongTypeConverterTests, StringToShortTypeConverterTests, and StringToSingleTypeConverterTests with additional test cases for null inputs, zero values, and negative values.
- Created DependencyResolverRegistrarTests to ensure proper registration and resolution of services, including tests for null checks and contract handling.
- Implemented a mock dependency resolver for testing purposes to verify interactions with the registrar.
@glennawatson glennawatson merged commit 6d3eb99 into main Jan 18, 2026
4 checks passed
@glennawatson glennawatson deleted the glennawatson/improve-test-coverage branch January 18, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants