-
Notifications
You must be signed in to change notification settings - Fork 1k
Add code coverage for ImageListConverter & RelatedImageListAttribute #13511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add code coverage for ImageListConverter & RelatedImageListAttribute #13511
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13511 +/- ##
====================================================
+ Coverage 62.21083% 76.60416% +14.39332%
====================================================
Files 3213 3238 +25
Lines 638302 639353 +1051
Branches 47201 47314 +113
====================================================
+ Hits 397093 489771 +92678
+ Misses 234153 146058 -88095
+ Partials 7056 3524 -3532
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds unit tests to improve code coverage for ImageListConverter
and RelatedImageListAttribute
.
- Introduce
RelatedImageListAttributeTests
covering constructor behavior - Introduce
ImageListConverterTests
covering base type assignment andGetPropertiesSupported
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/test/unit/System.Windows.Forms/System/Windows/Forms/RelatedImageListAttributeTests.cs | Add test verifying that constructor value is returned by RelatedImageList property |
src/test/unit/System.Windows.Forms/System/Windows/Forms/ImageListConverterTests.cs | Add tests for default constructor base type and GetPropertiesSupported |
Comments suppressed due to low confidence (4)
src/test/unit/System.Windows.Forms/System/Windows/Forms/RelatedImageListAttributeTests.cs:4
- Test namespace 'System.Windows.Forms.Controls.Tests' does not align with the project’s folder and other test namespaces. Consider using 'System.Windows.Forms.Tests' to match existing patterns.
namespace System.Windows.Forms.Controls.Tests;
src/test/unit/System.Windows.Forms/System/Windows/Forms/RelatedImageListAttributeTests.cs:14
- Consider adding tests for
Equals
,GetHashCode
, and default attribute behavior to cover the fullRelatedImageListAttribute
API surface.
RelatedImageListAttribute attr = new(value);
src/test/unit/System.Windows.Forms/System/Windows/Forms/ImageListConverterTests.cs:6
- Test namespace 'System.Windows.Forms.Controls.Tests' should be updated to 'System.Windows.Forms.Tests' to align with the assembly under test.
namespace System.Windows.Forms.Controls.Tests;
src/test/unit/System.Windows.Forms/System/Windows/Forms/ImageListConverterTests.cs:21
- Add tests for
GetProperties
,ConvertTo
, andConvertFrom
methods ofImageListConverter
to ensure functionality beyond support flags is covered.
Converter.GetPropertiesSupported(null).Should().BeTrue();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than small comments, all LGTM!
src/test/unit/System.Windows.Forms/System/Windows/Forms/ImageListConverterTests.cs
Show resolved
Hide resolved
src/test/unit/System.Windows.Forms/System/Windows/Forms/RelatedImageListAttributeTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Related #13442
Proposed changes
Add unit test file: ImageListConverterTests.cs & RelatedImageListAttributeTests for public/Internal methods of the ImageListConverter.cs & RelatedImageListAttribute.cs
Microsoft Reviewers: Open in CodeFlow