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 DesignerFrame #12712

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

Conversation

Nora-Zhou01
Copy link
Member

@Nora-Zhou01 Nora-Zhou01 commented Jan 6, 2025

Related #10773

Proposed changes

  • Add unit test DesignerFrameTests.cs for public properties and method of the DesignerFrame
  • Enable nullability in DesignerFrameTests.cs
Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.02710%. Comparing base (e91e3bc) to head (a979bd5).
Report is 122 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (e91e3bc) and HEAD (a979bd5). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (e91e3bc) HEAD (a979bd5)
Debug 3 2
test 1 0
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     
Flag Coverage Δ
Debug 50.02710% <ø> (-25.72745%) ⬇️
integration 18.14834% <ø> (-0.02644%) ⬇️
production 50.02710% <ø> (+0.70955%) ⬆️
test ?
unit 47.24142% <ø> (+0.70971%) ⬆️

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

@ricardobossan ricardobossan added the 📭 waiting-author-feedback The team requires more information from the author label Jan 6, 2025
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Jan 9, 2025
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);
Copy link
Member

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?

@Tanya-Solyanik Tanya-Solyanik added the 📭 waiting-author-feedback The team requires more information from the author label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📭 waiting-author-feedback The team requires more information from the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants