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

Removing assertion from constructor EditorServiceContext and update test "InvokeItemsDialog_ShouldThrowException" #13140

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Mar 14, 2025

Proposed changes

  • Removing assertion from constructor EditorServiceContext and update test InvokeItemsDialog_ShouldThrowException

  • Fix for test failures like this one

  • Need PropertyDescriptor for ICollection property to associate collection editor with.
    at System.Windows.Forms.Design.EditorServiceContext..ctor(ComponentDesigner designer, PropertyDescriptor prop) in //src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/EditorServiceContext.cs:line 34
    at System.Windows.Forms.Design.EditorServiceContext.EditValue(ComponentDesigner designer, Object objectToChange, String propName) in /
    /src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/EditorServiceContext.cs:line 48
    at System.Windows.Forms.Design.ListControlUnboundActionList.InvokeItemsDialog() in //src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/ListControlUnboundActionList.cs:line 20
    at FluentAssertions.Specialized.ActionAssertions.InvokeSubject()
    at FluentAssertions.Specialized.DelegateAssertions2.InvokeSubjectWithInterception() at FluentAssertions.Specialized.DelegateAssertions2.Throw[TException](String because, Object[] becauseArgs)
    at System.Windows.Forms.Design.Tests.ListControlUnboundActionListTests.InvokeItemsDialog_ShouldThrowException() in /
    /src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/ListControlUnboundActionListTests.cs:line 49

Microsoft Reviewers: Open in CodeFlow

…est "InvokeItemsDialog_ShouldThrowException"
@LeafShi1 LeafShi1 requested a review from a team as a code owner March 14, 2025 08:46
@LeafShi1 LeafShi1 marked this pull request as draft March 14, 2025 08:47
Copy link

codecov bot commented Mar 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.35120%. Comparing base (3ec6746) to head (7a44eaf).
Report is 2 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13140         +/-   ##
===================================================
- Coverage   61.35965%   61.35120%   -0.00846%     
===================================================
  Files           1547        1547                 
  Lines         158482      158481          -1     
  Branches       14752       14752                 
===================================================
- Hits           97244       97230         -14     
- Misses         60536       60548         +12     
- Partials         702         703          +1     
Flag Coverage Δ
Debug 61.35120% <100.00000%> (-0.00846%) ⬇️
integration 10.73267% <ø> (+0.00116%) ⬆️
production 39.22000% <ø> (-0.01412%) ⬇️
test 95.67947% <100.00000%> (ø)
unit 36.65252% <ø> (-0.01416%) ⬇️

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dotnet-policy-service dotnet-policy-service bot added the draft draft PR label Mar 14, 2025
@@ -44,6 +44,6 @@ public void GetSortedActionItems_ShouldReturnCorrectItems()
public void InvokeItemsDialog_ShouldThrowException()
{
Action action = _actionList.InvokeItemsDialog;
action.Should().Throw<Exception>();
action.Should().Throw<NullReferenceException>();
Copy link
Member

Choose a reason for hiding this comment

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

We should use a real component that had "Items" property instead of a mock so that we have a valid property descriptor.

The debug.Assert is completely valid and we should keep it for debugging.

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

Successfully merging this pull request may close these issues.

2 participants