feat(tests): add multi-targeting and source generator improvements#274
Merged
Conversation
- Removed redundant null-forgiving operators in test assertions. - Updated parameter names to underscore (_) for unused variables. - Renamed variables to adhere to standard naming conventions. - Replaced async lambdas with direct task creation where applicable. - Suppressed unused code warnings with proper comments. - Simplified feature collection creation by reusing variables. - Improved disposable enumerator usage with 'using' declaration. - Deleted unused test cases to focus on relevance. - Applied `pragma` to suppress dynamic code analysis warnings. - Replaced out variable usage with discard (`_`) in test setups. - Added missing ReSharper suppression comments.
…ully qualified name - Updated `[GeneratedCode]` to use fully qualified `global::System.CodeDom.Compiler.GeneratedCode`. - Removed redundant `using System.CodeDom.Compiler` directives from snapshots.
…in unit tests - Updated `GeneratorTestHelpers` with conditional references based on target framework. - Added `[RequiresAssemblyFiles]` attribute for reflection warnings on `GenerateFromSource`. - Modified test project to target `net8.0`, `net9.0`, and `net10.0`. - Integrated `Basic.Reference.Assemblies` for .NET 8.0 and 10.0. - Updated `Directory.Build.props` for AOT compatibility in non-test projects. - Removed unused references and project dependencies.
…ring literals - Updated `LambdaHostOutputGenerator` to use raw string literals for `GeneratedCode` attribute. - Simplified string formatting and improved readability.
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #274 +/- ##
==========================================
+ Coverage 88.92% 88.95% +0.02%
==========================================
Files 132 132
Lines 3252 3251 -1
Branches 326 326
==========================================
Hits 2892 2892
+ Misses 243 242 -1
Partials 117 117
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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.

🚀 Pull Request
📋 Summary
This PR introduces multi-targeting support for unit tests across .NET 8.0, 9.0, and 10.0, along with source generator and code quality improvements.
Key changes:
GeneratedCodeattribute with fully qualified name to avoid namespace pollution✅ Checklist
🧪 Related Issues or PRs
N/A - General improvements and modernization
💬 Notes for Reviewers
Multi-targeting changes:
GeneratorTestHelpersnow includes conditional references based on target framework[RequiresAssemblyFiles]attribute for reflection warningsBasic.Reference.Assembliesfor .NET 8.0 and 10.0 supportDirectory.Build.propsfor AOT compatibility in non-test projectsSource generator changes:
[GeneratedCode]to[global::System.CodeDom.Compiler.GeneratedCode]in all generated codeusing System.CodeDom.Compilerin generated filesCode quality improvements:
_for unused parameters)