Skip to content

Update generated test verifications and packages#393

Merged
ChrisPulman merged 2 commits intomainfrom
FixTestGeneration
Apr 3, 2026
Merged

Update generated test verifications and packages#393
ChrisPulman merged 2 commits intomainfrom
FixTestGeneration

Conversation

@ChrisPulman
Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

fix for tests

What is the current behavior?

Tests failing to generate code for comparison

What is the new behavior?

Regenerate and adjust many test verification files to match updated source-generator output: rename generated properties/fields (e.g. to MyNamedProperty), adjust ObservableAsPropertyHelper nullability and protection levels, add/modify JSON/DataContract attributes (JsonInclude/JsonIgnore/DataMemberName), change property accessors (init/required/protected), and fix member-not-null placement.

Update Directory.Packages.props to add/reorder package versions (Basic.Reference.Assemblies for multiple frameworks, Splat, ReactiveUI, System.Reactive, TUnit, Verify.TUnit, etc.) and update the tests project and TestHelper accordingly.

Add helper methods to safely convert attribute named arguments and handle enum/raw values, plus add generated ReactiveCommand test verification files.

  • Modified AttributeDataExtensions.cs to import System.Globalization and replace direct TypedConstant.Value casts with TryConvertNamedArgument, which uses Convert.ChangeType with InvariantCulture and catches conversion errors.
  • Implemented TryGetRawValue to resolve enum constants from TypedConstant (including IFieldSymbol and member lookup).
  • Added four generated test verification files under src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD to capture expected ReactiveCommand outputs.

These changes ensure more robust conversion of attribute named arguments (including enums and numeric/string conversions) and provide test artifacts for the ReactiveCommand source generator.

What might this PR break?

N/A Tests only

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:

Regenerate and adjust many test verification files to match updated source-generator output: rename generated properties/fields (e.g. to MyNamedProperty), adjust ObservableAsPropertyHelper nullability and protection levels, add/modify JSON/DataContract attributes (JsonInclude/JsonIgnore/DataMemberName), change property accessors (init/required/protected), and fix member-not-null placement. Add a large set of new REACTIVECMD verification files. Update Directory.Packages.props to add/reorder package versions (Basic.Reference.Assemblies for multiple frameworks, Splat, ReactiveUI, System.Reactive, TUnit, Verify.TUnit, etc.) and update the tests project and TestHelper accordingly.
Add helper methods to safely convert attribute named arguments and handle enum/raw values, plus add generated ReactiveCommand test verification files.

- Modified AttributeDataExtensions.cs to import System.Globalization and replace direct TypedConstant.Value casts with TryConvertNamedArgument, which uses Convert.ChangeType with InvariantCulture and catches conversion errors.
- Implemented TryGetRawValue to resolve enum constants from TypedConstant (including IFieldSymbol and member lookup).
- Added four generated test verification files under src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD to capture expected ReactiveCommand outputs.

These changes ensure more robust conversion of attribute named arguments (including enums and numeric/string conversions) and provide test artifacts for the ReactiveCommand source generator.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 29.03226% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.84%. Comparing base (84aa282) to head (aca4eb4).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
....Roslyn/Core/Extensions/AttributeDataExtensions.cs 29.03% 16 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #393      +/-   ##
==========================================
+ Coverage   46.96%   55.84%   +8.88%     
==========================================
  Files          75       75              
  Lines        4035     4063      +28     
  Branches      491      500       +9     
==========================================
+ Hits         1895     2269     +374     
+ Misses       1986     1600     -386     
- Partials      154      194      +40     

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

@ChrisPulman ChrisPulman merged commit 1ea898c into main Apr 3, 2026
5 of 6 checks passed
@ChrisPulman ChrisPulman deleted the FixTestGeneration branch April 3, 2026 10:19
@github-actions
Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant