-
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 - 8 #28496
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 - 8 #28496
Conversation
Hey there @TamilarasanSF4853! 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.
Pull Request Overview
This pull request migrates and adapts several Compatibility.Core unit tests to run as device tests, ensuring that properties like text alignment, flow direction, navigation, and image button configuration behave as expected on different platforms.
- Added new tests for Editor and Entry controls on both Windows and iOS to verify text alignment and flow direction.
- Introduced tests for page view creation and navigation (including double disposal) on Android and iOS.
- Added a test for ImageButton to confirm it is created with the correct button type.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/Controls/tests/DeviceTests/Elements/Page/PageTests.Android.cs | Test for creating a platform view from a ContentPage on Android |
src/Controls/tests/DeviceTests/Elements/Editor/EditorTests.Windows.cs | Added test for verifying Editor text alignment and flow direction on Windows |
src/Controls/tests/DeviceTests/Elements/Editor/EditorTests.iOS.cs | Added test for verifying Editor text alignment on iOS |
src/Controls/tests/DeviceTests/Elements/Entry/EntryTests.Windows.cs | Added test for verifying Entry text alignment on Windows |
src/Controls/tests/DeviceTests/Elements/Entry/EntryTests.iOS.cs | Added test for verifying Entry text alignment on iOS |
src/Controls/tests/DeviceTests/Elements/Page/PageTests.iOS.cs | Test for creating a view controller from a ContentPage on iOS |
src/Controls/tests/DeviceTests/Elements/NavigationPage/NavigationPageTests.iOS.cs | Added test to ensure NavigationRenderer.Dispose can be safely called multiple times |
src/Core/tests/DeviceTests/Handlers/ImageButton/ImageButtonHandlerTests.iOS.cs | Added test to verify that ImageButton is created with the correct button type |
Content = new Label { Text = "Hello" } | ||
}; | ||
|
||
root.Dispatcher.DispatchAsync(() => |
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.
Consider awaiting the Dispatcher.DispatchAsync call in NavigationRendererDoubleDisposal to ensure that the Dispose calls complete before the test finishes.
root.Dispatcher.DispatchAsync(() => | |
await root.Dispatcher.DispatchAsync(async () => |
Copilot uses AI. Check for mistakes.
//src/Compatibility/Core/tests/iOS/NavigationTests.cs | ||
[Fact] | ||
[Description("Multiple calls to NavigationRenderer.Dispose shouldn't crash")] | ||
public void NavigationRendererDoubleDisposal() |
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.
public void NavigationRendererDoubleDisposal() | |
public async Task NavigationRendererDoubleDisposal() |
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.
Make NavigationRendererDoubleDisposal async Task
@rmarinho I've made the changes and committed them. Let me know if any further adjustments are needed. |
ea04055
to
d7b4a0a
Compare
@TamilarasanSF4853 Could you rebase to fix the conflicts? |
1be6d5e
to
2cec666
Compare
@jsuarezruiz I’ve rebased and resolved the conflicts |
ae21138
to
cd05e37
Compare
c3d7dd2
to
5b2afee
Compare
…s into device tests - 8 (#28496) * code changes added * updated code
…s into device tests - 8 (dotnet#28496) * code changes added * updated code
…s into device tests - 8 (#28496) * code changes added * updated code
…s into device tests - 8 (#28496) * code changes added * updated code
…s into device tests - 8 (#28496) * code changes added * updated code
…s into device tests - 8 (#28496) * code changes added * updated code
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 8st 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.
This pull request includes updates to various test files to add new tests and improve the existing ones. The key changes include adding new tests to verify text alignment and flow direction for
Editor
andEntry
controls, as well as tests for navigation and embedding functionalities.New Tests for Text Alignment and Flow Direction
src/Controls/tests/DeviceTests/Elements/Editor/EditorTests.Windows.cs
: Added a test to verify that theEditor
's text alignment and flow direction match the expected values whenFlowDirection
is applied explicitly or implicitly.src/Controls/tests/DeviceTests/Elements/Editor/EditorTests.iOS.cs
: Added a test to verify that theEditor
's text alignment matches the expected alignment whenFlowDirection
is applied explicitly or implicitly.src/Controls/tests/DeviceTests/Elements/Entry/EntryTests.Windows.cs
: Added a test to verify that theEntry
's text alignment matches the expected alignment whenFlowDirection
is applied explicitly or implicitly.src/Controls/tests/DeviceTests/Elements/Entry/EntryTests.iOS.cs
: Added a test to verify that theEntry
's text alignment matches the expected alignment whenFlowDirection
is applied explicitly or implicitly.Navigation and Embedding Tests
src/Controls/tests/DeviceTests/Elements/NavigationPage/NavigationPageTests.iOS.cs
: Added a test to ensure that multiple calls toNavigationRenderer.Dispose
do not cause a crash.src/Controls/tests/DeviceTests/Elements/Page/PageTests.Android.cs
: Added a test to verify that a platform view can be created from aContentPage
.src/Controls/tests/DeviceTests/Elements/Page/PageTests.iOS.cs
: Added a test to verify that a view controller can be created from aContentPage
.Other Updates
src/Core/tests/DeviceTests/Handlers/ImageButton/ImageButtonHandlerTests.iOS.cs
: Added a test to verify that anImageButton
is created with the correct button type.Issues Fixed
Fixes #27303