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

Avoids a System.InvalidCastException error to be thrown when passing ObjectCollection to AddRangeInternal of the DataGridViewComboBoxCell.ObjectCollection class #12613

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

ricardobossan
Copy link
Member

@ricardobossan ricardobossan commented Dec 9, 2024

Fixes #12612

Proposed changes

  • Avoids a System.InvalidCastException error to be thrown when passing ObjectCollection to AddRangeInternal of the DataGridViewComboBoxCell.ObjectCollection class, by:
    • Modifying the AddRange(ObjectCollection value) method
    • Adding the AddRangeInternal(ObjectCollection items) methods
  • Adds unit test

Customer Impact

  • Avoids a possible System.InvalidCastException

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

Captura de tela 2024-12-09 200542

After

image

Test methodology

  • Unit tests

Accessibility testing

Test environment(s)

  • 10.0.100-alpha.1.24573.1
Microsoft Reviewers: Open in CodeFlow

@ricardobossan
Copy link
Member Author

I've drafted this PR to wait for the merging of #12580, which also adds tests to the same class. Once #12580 is merged, I'll pull the changes and resolve any conflicts before marking this PR as ready for review.

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Project coverage is 49.78234%. Comparing base (230d349) to head (7f53401).
Report is 26 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (230d349) and HEAD (7f53401). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (230d349) HEAD (7f53401)
Debug 3 2
test 1 0
Additional details and impacted files
@@                 Coverage Diff                  @@
##                main      #12613          +/-   ##
====================================================
- Coverage   75.91962%   49.78234%   -26.13728%     
====================================================
  Files           3164        1979        -1185     
  Lines         636813      284155      -352658     
  Branches       47008       41746        -5262     
====================================================
- Hits          483466      141459      -342007     
+ Misses        149884      139996        -9888     
+ Partials        3463        2700         -763     
Flag Coverage Δ
Debug 49.78234% <0.00000%> (-26.13728%) ⬇️
integration 18.15164% <0.00000%> (-0.02478%) ⬇️
production 49.78234% <0.00000%> (+0.16512%) ⬆️
test ?
unit 46.97753% <0.00000%> (+0.14276%) ⬆️

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 Dec 10, 2024
@ricardobossan ricardobossan force-pushed the Issue_12612_Casting_Error_Thrown branch from baa8edf to b72cfc6 Compare December 11, 2024 01:52
@ricardobossan ricardobossan marked this pull request as ready for review December 11, 2024 01:56
@ricardobossan ricardobossan requested a review from a team as a code owner December 11, 2024 01:56
@dotnet-policy-service dotnet-policy-service bot removed the draft draft PR label Dec 11, 2024
@LeafShi1 LeafShi1 added the waiting-review This item is waiting on review by one or more members of team label Dec 13, 2024
@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 Dec 18, 2024
…ObjectCollection to AddRangeInternal of the DataGridViewComboBoxCell.ObjectCollection

Fixes dotnet#12612

## Proposed changes

- Avoids a `System.InvalidCastException` error to be thrown when passing
`ObjectCollection` to `AddRangeInternal` of the
`DataGridViewComboBoxCell.ObjectCollection` class, by:
  - Modifying the `AddRange(ObjectCollection value)` method
  - Adding the `AddRangeInternal(ObjectCollection items)` methods
- Adds unit test

## Customer Impact

- Avoids a possible `System.InvalidCastException`

## Regression?

- No

## Risk

- Minimal

## Screenshots

### Before

### After

## Test methodology

- Unit tests

## Accessibility testing

## Test environment(s)

- `10.0.100-alpha.1.24573.1`
@ricardobossan ricardobossan force-pushed the Issue_12612_Casting_Error_Thrown branch from b72cfc6 to 7f53401 Compare December 18, 2024 21:13
@dotnet-policy-service dotnet-policy-service bot removed the waiting-author-feedback The team requires more information from the author label Dec 18, 2024
@ricardobossan ricardobossan added the waiting-review This item is waiting on review by one or more members of team label Dec 18, 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.

Thank you!

@Tanya-Solyanik Tanya-Solyanik added ready-to-merge PRs that are ready to merge but worth notifying the internal team. and removed waiting-review This item is waiting on review by one or more members of team labels Dec 18, 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.

👍

@lonitra lonitra merged commit 8d96e56 into dotnet:main Dec 19, 2024
8 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0 Preview1 milestone Dec 19, 2024
@dotnet-policy-service dotnet-policy-service bot removed the ready-to-merge PRs that are ready to merge but worth notifying the internal team. label Dec 19, 2024
@MelonWang1
Copy link
Contributor

@ricardobossan Want to confirm with you if [WinFormsFact] is missing?

Untitled

ricardobossan pushed a commit to ricardobossan/winforms that referenced this pull request Dec 26, 2024
Fixes dotnet#12612
Related dotnet#12613

## Root Cause

- A `[WinFormsFact]` annotation was missing from a unit test in PR
dotnet#12613, causing the test not to execute as part of the suite.

## Proposed changes

- Add the missing `[WinFormsFact]` annotation to the relevant unit test.

## Customer Impact

- Ensures the test runs as intended, increasing coverage and preventing
regressions in the modified `DataGridViewComboBoxCell.ObjectCollection`
class.

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 10.0.100-alpha.1.24573.1
@ricardobossan
Copy link
Member Author

@MelonWang1 Thanks for catching that! I've added the [WinFormsFact] annotation now on PR #12685

LeafShi1 pushed a commit that referenced this pull request Dec 27, 2024
…12685)

Fixes #12612
Related #12613

## Root Cause

- A `[WinFormsFact]` annotation was missing from a unit test in PR
#12613, causing the test not to execute as part of the suite.

## Proposed changes

- Add the missing `[WinFormsFact]` annotation to the relevant unit test.

## Customer Impact

- Ensures the test runs as intended, increasing coverage and preventing
regressions in the modified `DataGridViewComboBoxCell.ObjectCollection`
class.

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 10.0.100-alpha.1.24573.1

Co-authored-by: Ricardo Bossan (BEYONDSOFT CONSULTING INC) (from Dev Box) <v-rbossan@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants