Skip to content
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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

ricardobossan
Copy link
Member

@ricardobossan ricardobossan commented Oct 31, 2024

Related #10773

Proposed changes

  • Adds coverage for ControlDesigner.
  • Introduces the CreateMockSiteWithDesignerHost() helper function, as the original (MockSite.CreateMockSiteWithDesignerHost()) was configured with MockBehavior.Strict, which conflicted with the requirements of ControlDesigner.GetGlyphs().

Customer Impact

  • None

Regression?

  • No

Risk

  • Minimal

Test methodology

  • Unit tests

Test environment(s)

  • 9.0.100-rc.2.24474.12

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.76511%. Comparing base (c4deca0) to head (6ee89b7).
Report is 27 commits behind head on main.

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     
Flag Coverage Δ
Debug 75.76511% <100.00000%> ( 26.57277%) ⬆️
integration 18.26792% <ø> ( 0.01602%) ⬆️
production 49.36416% <ø> ( 0.17181%) ⬆️
test 97.05232% <100.00000%> (?)
unit 46.44284% <ø> ( 0.26963%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@dotnet-policy-service dotnet-policy-service bot added the draft draft PR label Nov 1, 2024
@ricardobossan ricardobossan force-pushed the Issue_10773_Add_Coverage_To_ControlDesigner branch from 6e4b252 to 17f71da Compare November 6, 2024 02:50
@ricardobossan ricardobossan force-pushed the Issue_10773_Add_Coverage_To_ControlDesigner branch from 17f71da to 89822b7 Compare November 6, 2024 15:15
@ricardobossan ricardobossan marked this pull request as ready for review November 6, 2024 22:39
@ricardobossan ricardobossan requested a review from a team as a code owner November 6, 2024 22:39
@ricardobossan ricardobossan added waiting-review This item is waiting on review by one or more members of team and removed draft draft PR labels Nov 6, 2024
@lonitra lonitra added 📭 waiting-author-feedback The team requires more information from the author and removed waiting-review This item is waiting on review by one or more members of team labels Nov 7, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Nov 8, 2024
@ricardobossan ricardobossan added the waiting-review This item is waiting on review by one or more members of team label Nov 9, 2024
@LeafShi1 LeafShi1 added 📭 waiting-author-feedback The team requires more information from the author and removed waiting-review This item is waiting on review by one or more members of team labels Nov 11, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Nov 11, 2024
@ricardobossan ricardobossan added the waiting-review This item is waiting on review by one or more members of team label Nov 12, 2024
Copy link
Member

@Tanya-Solyanik Tanya-Solyanik left a 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/src/AssemblyRef.cs Outdated Show resolved Hide resolved
src/System.Windows.Forms.Design/src/AssemblyRef.cs Outdated Show resolved Hide resolved
_control.Dock = dockStyle;
SelectionRules finalSelectionRules = _designer.SelectionRules;

using (new NoAssertContext())
Copy link
Member

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.

@Tanya-Solyanik Tanya-Solyanik added 📭 waiting-author-feedback The team requires more information from the author and removed waiting-review This item is waiting on review by one or more members of team labels Nov 12, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Nov 12, 2024
Ricardo Bossan (BEYONDSOFT CONSULTING INC) (from Dev Box) added 2 commits November 12, 2024 17:57
@lonitra lonitra added the 📭 waiting-author-feedback The team requires more information from the author label Nov 13, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Nov 13, 2024
@ricardobossan ricardobossan force-pushed the Issue_10773_Add_Coverage_To_ControlDesigner branch from 49fb15a to ec2f020 Compare November 13, 2024 20:27
@ricardobossan ricardobossan force-pushed the Issue_10773_Add_Coverage_To_ControlDesigner branch from ec2f020 to 8808365 Compare November 13, 2024 20:30
@ricardobossan
Copy link
Member Author

ricardobossan commented Nov 13, 2024

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.

@Tanya-Solyanik I attempted to make the mock initialization reusable by extracting it to TestControlDesigner.Mocks in the latest commit. Is this acceptable?

Also, added the suggested test case.

@lonitra lonitra added the 📭 waiting-author-feedback The team requires more information from the author label Nov 13, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Nov 13, 2024
@ricardobossan ricardobossan added the waiting-review This item is waiting on review by one or more members of team label Nov 13, 2024
Copy link
Member

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, @LeafShi1 @lonitra - do you want to give this PR another look?

@Tanya-Solyanik Tanya-Solyanik removed the waiting-review This item is waiting on review by one or more members of team label Nov 14, 2024
Copy link
Member

@lonitra lonitra left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants