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

[Refactoring] Added protection for MonthCalendarAccessibleObject #2975

Merged

Conversation

vladimir-krestov
Copy link
Contributor

@vladimir-krestov vladimir-krestov commented Mar 14, 2020

Fixes #2475
Fixes #3034

Added protection for MonthCalendarAccessibleObject against incorrect parameters of methods to avoid exceptions throwing

Proposed changes

  • Add parentAccessibleObject null condition for GetCalendarCell method to avoid NullReferenceException throwing when getting rowIndex value on 373 line (MonthCalendar.MonthCalendarAccessibleObject.cs)
  • Check SYSTEMTIME parameter value for SysTimeToDateTime method to get correct DateTime value (DateTimePicker.cs)
  • Add unit tests

Customer Impact

  • User apps won't crash in these methods when there are incorrect parameters

Regression?

  • No

Risk

  • Minimal

Test methodology

  • Unit testing
  • Manual testing
  • CTI

Test environment(s)

  • .NET Core SDK: 5.0.0-alpha.1.20072.3
  • Microsoft Windows [Version 10.0.18363.592]
Microsoft Reviewers: Open in CodeFlow

@vladimir-krestov vladimir-krestov requested a review from a team as a code owner March 14, 2020 07:54
@vladimir-krestov vladimir-krestov added the waiting-review This item is waiting on review by one or more members of team label Mar 14, 2020
@vladimir-krestov
Copy link
Contributor Author

Hm, dotnet-winforms CI isn't passed. I didn't catch why.
The build and unit tests are success localy.
@RussKie could you please help?

@vladimir-krestov vladimir-krestov force-pushed the dev/v-vlkres/2475_ProptectMonthCalendar branch from 138805c to cbb6b23 Compare March 14, 2020 08:46
@codecov
Copy link

codecov bot commented Mar 14, 2020

Codecov Report

Merging #2975 into master will decrease coverage by 36.50246%.
The diff coverage is 59.13978%.

@@                 Coverage Diff                  @@
##              master       #2975          +/-   ##
====================================================
- Coverage   98.63134%   62.12888%   -36.50246%     
====================================================
  Files            422        1292         +870     
  Lines         202096      456192      +254096     
  Branches        2814       39576       +36762     
====================================================
+ Hits          199330      283427       +84097     
- Misses          2218      167401      +165183     
- Partials         548        5364        +4816     
Flag Coverage Δ
#Debug 62.12888% <59.13978%> (-36.50246%) ⬇️
#production 33.08417% <16.27907%> (?)
#test 98.63069% <96.00000%> (-0.00065%) ⬇️

@vladimir-krestov
Copy link
Contributor Author

I have solved CI build issue. Thanks, @weltkante.
I just swapped Debug.Fail to Debug.WriteLine

@ghost ghost added the waiting-author-feedback The team requires more information from the author label Mar 16, 2020
@RussKie RussKie removed the waiting-review This item is waiting on review by one or more members of team label Mar 16, 2020
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Mar 16, 2020
@vladimir-krestov vladimir-krestov changed the title [Refactoring] Added protection for MonthCalendarAccessibleObject WIP: [Refactoring] Added protection for MonthCalendarAccessibleObject Mar 16, 2020
@vladimir-krestov
Copy link
Contributor Author

@RussKie, I'll start CTI testing when you approve.

@vladimir-krestov vladimir-krestov added the waiting-review This item is waiting on review by one or more members of team label Mar 16, 2020
vladimir-krestov added a commit to vladimir-krestov/winforms that referenced this pull request Mar 23, 2020
to get correct data from WinAPI messages
Fixes Issue dotnet#2912
Related Issue dotnet#2475
Related PR dotnet#2975
@vladimir-krestov vladimir-krestov force-pushed the dev/v-vlkres/2475_ProptectMonthCalendar branch from 4a2637d to 87d2ce7 Compare March 23, 2020 20:06
@vladimir-krestov vladimir-krestov added the waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) label Mar 23, 2020
RussKie pushed a commit that referenced this pull request Mar 24, 2020
To get correct data from WinAPI messages

Fixes #2912
Related Issue #2475
Related PR #2975
Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

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

👍

@RussKie RussKie removed the waiting-review This item is waiting on review by one or more members of team label Mar 24, 2020
@vladimir-krestov vladimir-krestov force-pushed the dev/v-vlkres/2475_ProptectMonthCalendar branch from e653f04 to 1b38364 Compare March 24, 2020 08:41
@RussKie
Copy link
Member

RussKie commented Apr 6, 2020

Please prepare a patch for 3.1 as well.

@vladimir-krestov vladimir-krestov force-pushed the dev/v-vlkres/2475_ProptectMonthCalendar branch from 1b38364 to 4dca299 Compare April 6, 2020 15:22
@vladimir-krestov vladimir-krestov changed the title WIP: [Refactoring] Added protection for MonthCalendarAccessibleObject [Refactoring] Added protection for MonthCalendarAccessibleObject Apr 6, 2020
@vladimir-krestov vladimir-krestov force-pushed the dev/v-vlkres/2475_ProptectMonthCalendar branch from 832b149 to 7c01e91 Compare April 12, 2020 17:26
@vladimir-krestov vladimir-krestov changed the title WIP: [Refactoring] Added protection for MonthCalendarAccessibleObject [Refactoring] Added protection for MonthCalendarAccessibleObject Apr 20, 2020
Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

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

👍

@RussKie RussKie removed the waiting-review This item is waiting on review by one or more members of team label Apr 20, 2020
@RussKie RussKie marked this pull request as draft April 20, 2020 06:00
Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

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

Great job!

Do you feel that having created MauiMonthCalendarTests we still need tests employing RemoteExecutor?

@vladimir-krestov vladimir-krestov removed the waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) label May 6, 2020
@vladimir-krestov vladimir-krestov force-pushed the dev/v-vlkres/2475_ProptectMonthCalendar branch from 1ea973f to a65123d Compare May 6, 2020 12:33
@vladimir-krestov vladimir-krestov added the waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) label May 6, 2020
@vladimir-krestov
Copy link
Contributor Author

Do you feel that having created MauiMonthCalendarTests we still need tests employing RemoteExecutor?

No, I have removed the unit tests. All test cases are implemented as maui tests.
Thank you.

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

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

👍

@RussKie
Copy link
Member

RussKie commented May 8, 2020

Please rebase on the latest - the failing MAUI test was fixed by @M-Lipin.

@vladimir-krestov
Copy link
Contributor Author

Cool, thank you!

@vladimir-krestov vladimir-krestov force-pushed the dev/v-vlkres/2475_ProptectMonthCalendar branch from a65123d to 60faf3d Compare May 8, 2020 07:27
@vladimir-krestov vladimir-krestov removed the waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) label May 10, 2020
@vladimir-krestov
Copy link
Contributor Author

Testers approved the fix ✔️

@vladimir-krestov vladimir-krestov marked this pull request as ready for review May 10, 2020 09:11
against incorrect parameters of methods to avoid exception throwing
Related Issues dotnet#2912 and dotnet#2475
Related PR dotnet#2911
@vladimir-krestov vladimir-krestov force-pushed the dev/v-vlkres/2475_ProptectMonthCalendar branch from 5182bb4 to 5b96cf9 Compare May 12, 2020 06:30
@vladimir-krestov vladimir-krestov force-pushed the dev/v-vlkres/2475_ProptectMonthCalendar branch from 5b96cf9 to 1635bc5 Compare May 12, 2020 07:58
@vladimir-krestov
Copy link
Contributor Author

PR is ready, please check.

@RussKie RussKie merged commit e06255c into dotnet:master May 15, 2020
@ghost ghost added this to the 5.0 Preview6 milestone May 15, 2020
@vladimir-krestov vladimir-krestov deleted the dev/v-vlkres/2475_ProptectMonthCalendar branch November 4, 2020 07:36
@ghost ghost locked as resolved and limited conversation to collaborators Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants