-
Notifications
You must be signed in to change notification settings - Fork 998
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 unit tests for DesignerFrame #12712
base: main
Are you sure you want to change the base?
Add unit tests for DesignerFrame #12712
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12712 +/- ##
===================================================
+ Coverage 75.75455% 76.15732% +0.40277%
===================================================
Files 3159 3176 +17
Lines 635942 639861 +3919
Branches 46987 47204 +217
===================================================
+ Hits 481755 487301 +5546
+ Misses 150726 149053 -1673
- Partials 3461 3507 +46
Flags with carried forward coverage won't be shown. Click here to find out more. |
...ystem.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerFrameTests.cs
Outdated
Show resolved
Hide resolved
...ystem.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerFrameTests.cs
Outdated
Show resolved
Hide resolved
...ystem.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DesignerFrameTests.cs
Show resolved
Hide resolved
FieldInfo? designerField = typeof(DesignerFrame).GetField("_designer", BindingFlags.NonPublic | BindingFlags.Instance); | ||
object designer = designerField?.GetValue(designerFrame) ?? throw new InvalidOperationException("Field '_designer' not found in DesignerFrame."); | ||
|
||
designer.Should().Be(control); |
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.
Hm, this test looks strange, designer can't be the same thing as the control.
Is t possible to replace reflection with internal methods that access the designer within the frame?
Related #10773
Proposed changes
Microsoft Reviewers: Open in CodeFlow