-
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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12712 +/- ##
====================================================
- Coverage 75.75455% 50.02710% -25.72745%
====================================================
Files 3159 1979 -1180
Lines 635942 284168 -351774
Branches 46987 41745 -5242
====================================================
- Hits 481755 142161 -339594
+ Misses 150726 139305 -11421
+ Partials 3461 2702 -759
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