-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Testing] Migration of Compatibility.Core platform-specific unit tests into device tests - 3 #28103
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
[Testing] Migration of Compatibility.Core platform-specific unit tests into device tests - 3 #28103
Conversation
|
Hey there @anandhan-rajagopal! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR migrates a group of platform-specific unit tests from Compatibility.Core to device tests to ensure that properties like IsEnabled, Background, CornerRadius, and others are consistent with their native implementations across Android, iOS, and Windows. Key changes include:
- Adding device tests for the IsEnabled property on various controls (BoxView, CheckBox, SwipeView, Editor, Label, RadioButton, SearchBar).
- Introducing new tests to validate additional properties (Background for BoxView, CornerRadius for Button and RadioButton).
- Updating test files to use platform-specific native view queries and assertions.
Reviewed Changes
| File | Description |
|---|---|
| src/Controls/tests/DeviceTests/Elements/BoxView/BoxViewTests.Windows.cs | Added test to verify BoxView.IsEnabled against native view. |
| src/Controls/tests/DeviceTests/Elements/SwipeView/SwipeViewTests.Android.cs | Added test to verify SwipeView.IsEnabled against native view. |
| src/Controls/tests/DeviceTests/Elements/Editor/EditorTests.Android.cs | Added test confirming Editor.IsEnabled is correctly propagated. |
| src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.Android.cs | Added test to verify CheckBox.IsEnabled with native property, similar changes in iOS and Windows. |
| src/Controls/tests/DeviceTests/Elements/BoxView/BoxViewTests.Android.cs | Added test to validate BoxView.IsEnabled consistency on Android. |
| src/Controls/tests/DeviceTests/Elements/BoxView/BoxViewTests.cs | Added test to validate BoxView.Background consistency. |
| src/Controls/tests/DeviceTests/Elements/RadioButton/RadioButtonTests.Windows.cs | Added tests for both RadioButton CornerRadius and IsEnabled. |
| src/Controls/tests/DeviceTests/Elements/Button/ButtonTests.iOS.cs | Added test to verify Button CornerRadius against the native layer. |
| src/Controls/tests/DeviceTests/Elements/SearchBar/SearchBarTests.Android.cs | Added test to verify SearchBar.IsEnabled on Android. |
| src/Controls/tests/DeviceTests/Elements/SearchBar/SearchBarTests.Windows.cs | Added test to verify SearchBar.IsEnabled on Windows. |
| src/Controls/tests/DeviceTests/Elements/Label/LabelTests.Android.cs | Added test to verify Label.IsEnabled against native view. |
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.Android.cs:17
- [nitpick] Consider standardizing test method naming across the suite for consistency and clarity. For instance, use a naming convention like 'Verify[Element]IsEnabledProperty' consistently in all tests.
[Fact("The IsEnabled of a CheckBox should match with native IsEnabled")]
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/rebase |
e8839cf to
8e23646
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rebase to fix the conflicts? Thanks in advance.
8e23646 to
4a18930
Compare
@jsuarezruiz Rebased and resolved the conflicts. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
| @@ -1,4 +1,6 @@ | |||
| using Microsoft.Maui.Handlers; | |||
| using Microsoft.Maui.Handlers; | |||
| using System.ComponentModel; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this is a merge issue. Appears two times.
C:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\RadioButton\RadioButtonTests.Windows.cs(5,7): error CS0105: The using directive for 'System.ComponentModel' appeared previously in this namespace [C:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-windows10.0.19041.0]
C:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\RadioButton\RadioButtonTests.Windows.cs(6,7): error CS0105: The using directive for 'System.Threading.Tasks' appeared previously in this namespace [C:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-windows10.0.19041.0]
C:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\RadioButton\RadioButtonTests.Windows.cs(28,42): error CS0103: The name 'handler' does not exist in the current context [C:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-windows10.0.19041.0]
C:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\RadioButton\RadioButtonTests.Windows.cs(5,7): error CS0105: The using directive for 'System.ComponentModel' appeared previously in this namespace [C:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-windows10.0.20348.0]
C:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\RadioButton\RadioButtonTests.Windows.cs(6,7): error CS0105: The using directive for 'System.Threading.Tasks' appeared previously in this namespace [C:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-windows10.0.20348.0]
C:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\RadioButton\RadioButtonTests.Windows.cs(28,42): error CS0103: The name 'handler' does not exist in the current context [C:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-windows10.0.20348.0]
6 Error(s)
Could you fix the build errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuarezruiz, Resolved the build errors and committed the changes
|
/rebase |
…/anandhan-rajagopal/maui into enabled-UnitTest-To-DeviceTest-1
@jsuarezruiz resolved conflicts and rebased the branch |
…s into device tests - 3 (#28103) * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Update BoxViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.Android.cs * Resolved conflict errors * Update BoxViewTests.Android.cs --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com>
…s into device tests - 3 (#28103) * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Update BoxViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.Android.cs * Resolved conflict errors * Update BoxViewTests.Android.cs --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com>
…s into device tests - 3 (#28103) * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Update BoxViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.Android.cs * Resolved conflict errors * Update BoxViewTests.Android.cs --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com>
…s into device tests - 3 (#28103) * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Update BoxViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.Android.cs * Resolved conflict errors * Update BoxViewTests.Android.cs --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com>
…s into device tests - 3 (#28103) * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Update BoxViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.Android.cs * Resolved conflict errors * Update BoxViewTests.Android.cs --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com>
…s into device tests - 3 (dotnet#28103) * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Update BoxViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.Android.cs * Resolved conflict errors * Update BoxViewTests.Android.cs --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com>
…s into device tests - 3 (#28103) * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Update BoxViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.Android.cs * Resolved conflict errors * Update BoxViewTests.Android.cs --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com>
…s into device tests - 3 (#28103) * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Update BoxViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.Android.cs * Resolved conflict errors * Update BoxViewTests.Android.cs --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com>
…s into device tests - 3 (#28103) * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Update BoxViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.Android.cs * Resolved conflict errors * Update BoxViewTests.Android.cs --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com>
…s into device tests - 3 (#28103) * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Update BoxViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Added the CornerRadius and IsEnabled property for DeviceTest * IsEnabled property for Device tests * Addressed the feedbacks * Update BoxViewTests.cs * modified code changes * resolved windows build error * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.iOS.cs * removed unwanted namespace * Update CheckBoxTests.cs * Update SwipeViewTests.Android.cs * Resolved build error in windows * Update RadioButtonTests.Windows.cs * Update CheckBoxTests.Android.cs * Resolved conflict errors * Update BoxViewTests.Android.cs --------- Co-authored-by: nivetha-nagalingam <nivetha.nagalingam@syncfusion.com>
Description of Change
Migration of Compatibility.Core platform-specific unit tests to device tests. Here the migrated cases which ensuring that the IsEnabled and CornerRadius consistency of different elements matches their native counterparts. We are going to migrate tests in blocks in different PRs. This is the 3st group.
There are unit tests under:
That are not running right now. these cases from Xamarin.Forms where they could run as unit tests, but now with .NET MAUI this is not possible. So here I migrated the following cases in device tests.
Verification of
IsEnabledProperty:src/Controls/tests/DeviceTests/Elements/BoxView/BoxViewTests.Android.cs: Added a test to verify that theIsEnabledproperty of aBoxViewmatches the nativeIsEnabledproperty.src/Controls/tests/DeviceTests/Elements/CheckBox/CheckBoxTests.Android.cs: Added a test to verify that theIsEnabledproperty of aCheckBoxmatches the nativeIsEnabledproperty.src/Controls/tests/DeviceTests/Elements/Label/LabelTests.Android.cs: Added a test to verify that theIsEnabledproperty of aLabelmatches the nativeIsEnabledproperty.src/Controls/tests/DeviceTests/Elements/SearchBar/SearchBarTests.Android.cs: Added a test to verify that theIsEnabledproperty of aSearchBarmatches the nativeIsEnabledproperty.src/Controls/tests/DeviceTests/Elements/SwipeView/SwipeViewTests.Android.cs: Added a test to verify that theIsEnabledproperty of aSwipeViewmatches the nativeIsEnabledproperty.Verification of Other Properties:
src/Controls/tests/DeviceTests/Elements/BoxView/BoxViewTests.cs: Added a test to verify that theBackgroundproperty of aBoxViewmatches the nativeBackground.src/Controls/tests/DeviceTests/Elements/Button/ButtonTests.iOS.cs: Added a test to verify that theCornerRadiusproperty of aButtonmatches the nativeCornerRadius.src/Controls/tests/DeviceTests/Elements/RadioButton/RadioButtonTests.Windows.cs: Added a test to verify that theCornerRadiusproperty of aRadioButtonmatches the nativeCornerRadius.Issues Fixed
Fixes #27303