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 4 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

Attention: Patch coverage is 98.24561% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.15732%. Comparing base (e91e3bc) to head (8041f81).
Report is 131 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #12712         +/-   ##
===================================================
+ Coverage   75.75455%   76.15732%   +0.40277%     
===================================================
  Files           3159        3176         +17     
  Lines         635942      639861       +3919     
  Branches       46987       47204        +217     
===================================================
+ Hits          481755      487301       +5546     
+ Misses        150726      149053       -1673     
- Partials        3461        3507         +46     
Flag Coverage Δ
Debug 76.15732% <98.24561%> (+0.40277%) ⬆️
integration 18.15090% <ø> (-0.02388%) ⬇️
production 50.03343% <ø> (+0.71588%) ⬆️
test 97.02568% <98.24561%> (-0.01939%) ⬇️
unit 47.24688% <ø> (+0.71517%) ⬆️

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
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Jan 10, 2025
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.

3 participants