Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Feb 28, 2025

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:

  • src\Compatibility\Core\tests\Android
  • src\Compatibility\Core\tests\iOS
  • src\Compatibility\Core\tests\WinUI

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 IsEnabled Property:

Verification of Other Properties:

Issues Fixed

Fixes #27303

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Feb 28, 2025
@dotnet-policy-service
Copy link
Contributor

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.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Feb 28, 2025
@ghost ghost added the area-testing Unit tests, device tests label Feb 28, 2025
@ghost ghost marked this pull request as ready for review February 28, 2025 12:11
Copilot AI review requested due to automatic review settings February 28, 2025 12:11
@ghost ghost self-requested a review as a code owner February 28, 2025 12:11
@ghost ghost requested review from StephaneDelcroix and jfversluis February 28, 2025 12:11
Copy link
Contributor

Copilot AI left a 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")]

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/rebase

@github-actions github-actions bot force-pushed the enabled-UnitTest-To-DeviceTest-1 branch from e8839cf to 8e23646 Compare March 5, 2025 10:18
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a 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.

@ghost ghost force-pushed the enabled-UnitTest-To-DeviceTest-1 branch from 8e23646 to 4a18930 Compare March 7, 2025 09:01
@ghost
Copy link
Author

ghost commented Mar 7, 2025

Could you rebase to fix the conflicts? Thanks in advance.

@jsuarezruiz Rebased and resolved the conflicts.

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@@ -1,4 +1,6 @@
using Microsoft.Maui.Handlers;
using Microsoft.Maui.Handlers;
using System.ComponentModel;
Copy link
Contributor

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?

Copy link
Author

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

@jsuarezruiz
Copy link
Contributor

/rebase

@ghost
Copy link
Author

ghost commented Mar 21, 2025

@anandhan-rajagopal Could you fix the conflicts?

@jsuarezruiz resolved conflicts and rebased the branch

@rmarinho rmarinho merged commit ea04055 into dotnet:inflight/current Mar 26, 2025
1 check passed
PureWeen pushed a commit that referenced this pull request Mar 26, 2025
…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>
PureWeen pushed a commit that referenced this pull request Mar 28, 2025
…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>
github-actions bot pushed a commit that referenced this pull request Apr 2, 2025
…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>
github-actions bot pushed a commit that referenced this pull request Apr 3, 2025
…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>
github-actions bot pushed a commit that referenced this pull request Apr 8, 2025
…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>
bhavanesh2001 pushed a commit to bhavanesh2001/maui that referenced this pull request Apr 11, 2025
…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>
PureWeen pushed a commit that referenced this pull request Apr 11, 2025
…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>
github-actions bot pushed a commit that referenced this pull request Apr 11, 2025
…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>
github-actions bot pushed a commit that referenced this pull request Apr 14, 2025
…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>
github-actions bot pushed a commit that referenced this pull request Apr 15, 2025
…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>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Compatibility.Core platform-specific unit tests to device tests

3 participants