Skip to content

chore: increase the amount of unit testing#5

Merged
glennawatson merged 7 commits intomainfrom
feature/add-missing-tests
Feb 20, 2026
Merged

chore: increase the amount of unit testing#5
glennawatson merged 7 commits intomainfrom
feature/add-missing-tests

Conversation

@glennawatson
Copy link
Contributor

This pull request makes two main changes to the ReactiveUI.Binding source generators: it updates the generated binding code to use RxBindingExtensions instead of ObservableExtensions for observable operations, and it ensures that generated binding classes are excluded from code coverage analysis. These changes help with code clarity, maintainability, and test reporting.

Generated code improvements:

  • All generated binding code now uses global::ReactiveUI.Binding.Observables.RxBindingExtensions instead of ObservableExtensions for observable operations such as Select, Subscribe, Skip, Merge, Switch, and DistinctUntilChanged in the source generator output. This affects the code generation for one-way, two-way, and observation bindings. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]

Code coverage improvements:

  • Adds the [ExcludeFromCodeCoverage] attribute to the ReactiveSchedulerExtensions class and to a new generated partial class __ReactiveUIGeneratedBindings, ensuring that generated binding code is not included in code coverage metrics. [1] [2]

@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

❌ Patch coverage is 97.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.82%. Comparing base (010024f) to head (35602de).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...veUI.Binding.SourceGenerators/MetadataExtractor.cs 92.00% 0 Missing and 2 partials ⚠️
...tiveUI.Binding/Builder/ReactiveUIBindingBuilder.cs 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main       #5       +/-   ##
===========================================
+ Coverage   55.51%   97.82%   +42.30%     
===========================================
  Files         180      164       -16     
  Lines        8410     5556     -2854     
  Branches     1377      995      -382     
===========================================
+ Hits         4669     5435      +766     
+ Misses       3324       30     -3294     
+ Partials      417       91      -326     

☔ 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.

@glennawatson glennawatson requested a review from Copilot February 19, 2026 22:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request significantly increases unit test coverage for the ReactiveUI.Binding library by adding comprehensive tests for type converters and updating the testing infrastructure. The changes focus on testing the binding framework's type conversion capabilities while ensuring that generated code is properly excluded from code coverage analysis.

Changes:

  • Added unit tests for 14 type converter classes covering DateTime, DateTimeOffset, DateOnly, TimeOnly, TimeSpan, Guid, Boolean, and Double conversions
  • Refactored test assembly initialization from ModuleInitializer to [Before(Assembly)] pattern
  • Updated generated code to exclude from code coverage via [ExcludeFromCodeCoverage] attribute

Reviewed changes

Copilot reviewed 300 out of 386 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
StringToDateTimeTypeConverterTests.cs Tests string-to-DateTime conversion scenarios
StringToDateTimeOffsetTypeConverterTests.cs Tests string-to-DateTimeOffset conversion scenarios
StringToDateOnlyTypeConverterTests.cs Tests string-to-DateOnly conversion for .NET 6+
NullableTimeSpanToStringTypeConverterTests.cs Tests nullable TimeSpan-to-string conversion
NullableTimeOnlyToStringTypeConverterTests.cs Tests nullable TimeOnly-to-string conversion for .NET 6+
NullableGuidToStringTypeConverterTests.cs Tests nullable Guid-to-string conversion
NullableDoubleToDoubleTypeConverterTests.cs Tests nullable double-to-double conversion
NullableDateTimeToStringTypeConverterTests.cs Tests nullable DateTime-to-string conversion
NullableDateTimeOffsetToStringTypeConverterTests.cs Tests nullable DateTimeOffset-to-string conversion
NullableDateOnlyToStringTypeConverterTests.cs Tests nullable DateOnly-to-string conversion for .NET 6+
NullableBooleanToStringTypeConverterTests.cs Tests nullable boolean-to-string conversion
GuidToStringTypeConverterTests.cs Tests Guid-to-string conversion
DoubleToNullableDoubleTypeConverterTests.cs Tests double-to-nullable double conversion
DateTimeToStringTypeConverterTests.cs Tests DateTime-to-string conversion
DateTimeOffsetToStringTypeConverterTests.cs Tests DateTimeOffset-to-string conversion
DateOnlyToStringTypeConverterTests.cs Tests DateOnly-to-string conversion for .NET 6+
BooleanToStringTypeConverterTests.cs Tests boolean-to-string conversion
AssemblySetup.cs (multiple files) Refactored test initialization to use [Before(Assembly)]
RxBindingExtensions.cs Renamed from ObservableExtensions and added code coverage exclusion
BindingGenerator.cs Added [ExcludeFromCodeCoverage] attribute generation for generated bindings
Various generator tests Updated verified snapshots to include [ExcludeFromCodeCoverage] attribute

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@RLittlesII RLittlesII left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Improve coverage tests
@glennawatson glennawatson merged commit 6ca427c into main Feb 20, 2026
6 checks passed
@glennawatson glennawatson deleted the feature/add-missing-tests branch February 20, 2026 12:46
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.

3 participants