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

Add unit tests for FlowPanelDesigner #11735

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

Olina-Zhang
Copy link
Member

@Olina-Zhang Olina-Zhang commented Jul 23, 2024

Related #10773

Proposed changes

  • Add unit test file: FlowPanelDesignerTests.cs for public properties of the FlowPanelDesigner.cs file.
Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.97894%. Comparing base (d89527c) to head (f6a6314).
Report is 46 commits behind head on feature/10.0.

Additional details and impacted files
@@                  Coverage Diff                   @@
##           feature/10.0      #11735         +/-   ##
======================================================
+ Coverage      74.73321%   74.97894%   +0.24572%     
======================================================
  Files              3045        3029         -16     
  Lines            630638      630229        -409     
  Branches          46862       46740        -122     
======================================================
+ Hits             471296      472539       +1243     
+ Misses           155980      154344       -1636     
+ Partials           3362        3346         -16     
Flag Coverage Δ
Debug 74.97894% <100.00000%> (+0.24572%) ⬆️
integration 17.98054% <ø> (+0.02327%) ⬆️
production 48.12583% <ø> (+0.37456%) ⬆️
test 97.01580% <100.00000%> (+0.03046%) ⬆️
unit 45.16003% <ø> (+0.38812%) ⬆️

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


public sealed class FlowPanelDesignerTests
{
private (Panel panel, FlowPanelDesigner designer) SetupDesignerWithPanel()
Copy link
Member

Choose a reason for hiding this comment

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

panel never seems to be used in the tests. Let's remove returning it

Copy link
Member Author

Choose a reason for hiding this comment

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

designer.Initialize(panel) : the panel is passed to the Initialize method of FlowPanelDesigner. This step associates the FlowPanelDesigner with the Panel, allowing the designer to perform operations on the Panel.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, designer.Initialize(panel) is still necessary, but we do not need to return panel from this method since it is not used outside of this method. Signature for this method could just be :

private FlowPanelDesigner SetupDesignerWithPanel()

@lonitra lonitra added the 📭 waiting-author-feedback The team requires more information from the author label Jul 23, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Jul 24, 2024
@lonitra lonitra added the 📭 waiting-author-feedback The team requires more information from the author label Jul 30, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Aug 1, 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.

Thank you!

@lonitra lonitra merged commit a584478 into dotnet:feature/10.0 Aug 1, 2024
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants