-
Notifications
You must be signed in to change notification settings - Fork 984
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
Adds coverage to ControlDesigner #12410
base: main
Are you sure you want to change the base?
Adds coverage to ControlDesigner #12410
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12410 /- ##
====================================================
Coverage 49.19234% 75.76511% 26.57277%
====================================================
Files 1991 3154 1163
Lines 284154 635951 351797
Branches 41731 46987 5256
====================================================
Hits 139782 481829 342047
- Misses 141672 150676 9004
- Partials 2700 3446 746
Flags with carried forward coverage won't be shown. Click here to find out more. |
6e4b252
to
17f71da
Compare
17f71da
to
89822b7
Compare
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.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.
Looks great, I think we would want to reuse these Mocks in other tests eventually. Also consider adding test that verifies that WinProc calls the override of protected virtual void OnMouseDragEnd(bool cancel)
for designers derived from the COntrolDesigner. This can be done in the next PR.
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
_control.Dock = dockStyle; | ||
SelectionRules finalSelectionRules = _designer.SelectionRules; | ||
|
||
using (new NoAssertContext()) |
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.
@Zheng-Li01 - FYI - this is how we work around the assertion failures, I remember that you had this problem in one of the PRs.
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs
Outdated
Show resolved
Hide resolved
49fb15a
to
ec2f020
Compare
ec2f020
to
8808365
Compare
@Tanya-Solyanik I attempted to make the mock initialization reusable by extracting it to Also, added the suggested test case. |
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.
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.
LGTM, thanks for making those updates!
Related #10773
Proposed changes
ControlDesigner
.CreateMockSiteWithDesignerHost()
helper function, as the original (MockSite.CreateMockSiteWithDesignerHost()
) was configured withMockBehavior.Strict
, which conflicted with the requirements ofControlDesigner.GetGlyphs()
.Customer Impact
Regression?
Risk
Test methodology
Test environment(s)