Skip to content

Commit b1b3969

Browse files
TamilarasanSF4853jsuarezruiz
authored andcommitted
Revert "flow direction test"
This reverts commit 1f5c535.
1 parent 0c57ad8 commit b1b3969

File tree

6 files changed

+6
-247
lines changed

6 files changed

+6
-247
lines changed

src/Controls/tests/DeviceTests/Elements/Editor/EditorTests.Android.cs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using Microsoft.Maui.Controls;
55
using Microsoft.Maui.Handlers;
66
using Xunit;
7-
using Microsoft.Maui.Dispatching;
87

98
namespace Microsoft.Maui.DeviceTests
109
{
@@ -142,35 +141,5 @@ public async Task RotationConsistent()
142141
var platformRotation = await InvokeOnMainThreadAsync(() => PlatformEditor.Rotation);
143142
Assert.Equal(expected, platformRotation);
144143
}
145-
146-
[Theory]
147-
[InlineData(true, FlowDirection.LeftToRight, Android.Views.TextAlignment.ViewStart)]
148-
[InlineData(true, FlowDirection.RightToLeft, Android.Views.TextAlignment.ViewStart)]
149-
[InlineData(false, FlowDirection.LeftToRight, Android.Views.TextAlignment.ViewStart)]
150-
[InlineData(false, FlowDirection.RightToLeft, Android.Views.TextAlignment.ViewStart)]
151-
[Description("The Editor's text alignment should match the expected alignment when FlowDirection is applied explicitly or implicitly")]
152-
public async Task EditorAlignmentMatchesFlowDirection(bool isExplicit, FlowDirection flowDirection, Android.Views.TextAlignment expectedAlignment)
153-
{
154-
var editor = new Editor { Text = "Checking flow direction" };
155-
var contentPage = new ContentPage { Title = "Flow Direction", Content = editor };
156-
157-
if (isExplicit)
158-
{
159-
editor.FlowDirection = flowDirection;
160-
}
161-
else
162-
{
163-
contentPage.FlowDirection = flowDirection;
164-
}
165-
166-
var handler = await CreateHandlerAsync<EditorHandler>(editor);
167-
var nativeAlignment = await contentPage.Dispatcher.DispatchAsync(() =>
168-
{
169-
var textField = GetPlatformControl(handler);
170-
return textField.TextAlignment;
171-
});
172-
173-
Assert.Equal(expectedAlignment, nativeAlignment);
174-
}
175144
}
176145
}
Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
#nullable enable
2-
using Xunit;
3-
using System;
4-
using System.ComponentModel;
52
using System.Threading.Tasks;
6-
using Microsoft.Maui.Controls;
7-
using Microsoft.Maui.Dispatching;
83
using Microsoft.Maui.Handlers;
94
using Microsoft.UI.Xaml.Controls;
10-
using WFlowDirection = Microsoft.UI.Xaml.FlowDirection;
11-
using WTextAlignment = Microsoft.UI.Xaml.TextAlignment;
125

136
namespace Microsoft.Maui.DeviceTests
147
{
@@ -39,54 +32,5 @@ static int GetPlatformCursorPosition(EditorHandler editorHandler) =>
3932

4033
static int GetPlatformSelectionLength(EditorHandler editorHandler) =>
4134
GetPlatformControl(editorHandler).SelectionLength;
42-
43-
private async Task<Tuple<WTextAlignment, WFlowDirection>> GetEditorAlignmentAndFlowDirection(bool isExplicit, FlowDirection flowDirection)
44-
{
45-
var editor = new Editor { Text = " تسجيل الدخول" };
46-
var contentPage = new ContentPage { Title = "Flow Direction", Content = editor };
47-
48-
if (isExplicit)
49-
{
50-
editor.FlowDirection = flowDirection;
51-
}
52-
else
53-
{
54-
contentPage.FlowDirection = flowDirection;
55-
}
56-
var handler = await CreateHandlerAsync<EditorHandler>(editor);
57-
var (nativeAlignment, nativeFlowDirection) = await contentPage.Dispatcher.DispatchAsync(() =>
58-
{
59-
var textField = GetPlatformControl(handler);
60-
return (textField.TextAlignment, textField.FlowDirection);
61-
});
62-
return new Tuple<WTextAlignment, WFlowDirection>(nativeAlignment, nativeFlowDirection);
63-
}
64-
65-
[Fact]
66-
[Description("The Editor's text alignment and flow direction should match the expected values when FlowDirection is explicitly set to RightToLeft.")]
67-
public async Task EditorAlignmentMatchesFlowDirectionRtlExplicit()
68-
{
69-
var results = await GetEditorAlignmentAndFlowDirection(true, FlowDirection.RightToLeft);
70-
Assert.Equal(WTextAlignment.Left, results.Item1);
71-
Assert.Equal(WFlowDirection.RightToLeft, results.Item2);
72-
}
73-
74-
[Fact]
75-
[Description("The Editor's text alignment and flow direction should match the expected values when FlowDirection is explicitly set to LeftToRight.")]
76-
public async Task EditorAlignmentMatchesFlowDirectionLtrExplicit()
77-
{
78-
var results = await GetEditorAlignmentAndFlowDirection(true, FlowDirection.LeftToRight);
79-
Assert.Equal(WTextAlignment.Left, results.Item1);
80-
Assert.Equal(WFlowDirection.LeftToRight, results.Item2);
81-
}
82-
83-
[Fact]
84-
[Description("The Editor's text alignment and flow direction should match the expected values when FlowDirection is implicitly set to LeftToRight.")]
85-
public async Task EditorAlignmentMatchesFlowDirectionLtrImplicit()
86-
{
87-
var results = await GetEditorAlignmentAndFlowDirection(false, FlowDirection.LeftToRight);
88-
Assert.Equal(WTextAlignment.Left, results.Item1);
89-
Assert.Equal(WFlowDirection.LeftToRight, results.Item2);
90-
}
9135
}
9236
}

src/Controls/tests/DeviceTests/Elements/Editor/EditorTests.iOS.cs

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
using UIKit;
2-
using Xunit;
3-
using System.Linq;
1+
using System.Linq;
42
using System.Threading.Tasks;
53
using Microsoft.Maui.Controls;
6-
using Microsoft.Maui.Dispatching;
74
using Microsoft.Maui.Handlers;
85
using Microsoft.Maui.Hosting;
96
using Microsoft.Maui.Platform;
7+
using Xunit;
108
using static Microsoft.Maui.DeviceTests.AssertHelpers;
11-
using System.ComponentModel;
129

1310
namespace Microsoft.Maui.DeviceTests
1411
{
@@ -51,7 +48,7 @@ Task<float> GetPlatformOpacity(EditorHandler editorHandler)
5148
return InvokeOnMainThreadAsync(() =>
5249
{
5350
var nativeView = GetPlatformControl(editorHandler);
54-
return (float)nativeView.Alpha;
51+
return (float)nativeView.Alpha;
5552
});
5653
}
5754

@@ -97,34 +94,5 @@ await CreateHandlerAndAddToWindow(contentPage, async () =>
9794
});
9895
}
9996
}
100-
101-
[Theory]
102-
[InlineData(true, FlowDirection.LeftToRight, UITextAlignment.Left)]
103-
[InlineData(true, FlowDirection.RightToLeft, UITextAlignment.Right)]
104-
[InlineData(false, FlowDirection.LeftToRight, UITextAlignment.Left)]
105-
[Description("The Editor's text alignment should match the expected alignment when FlowDirection is applied explicitly or implicitly")]
106-
public async Task EditorAlignmentMatchesFlowDirection(bool isExplicit, FlowDirection flowDirection, UITextAlignment expectedAlignment)
107-
{
108-
var editor = new Editor { Text = "Checking flow direction" };
109-
var contentPage = new ContentPage { Title = "Flow Direction", Content = editor };
110-
111-
if (isExplicit)
112-
{
113-
editor.FlowDirection = flowDirection;
114-
}
115-
else
116-
{
117-
contentPage.FlowDirection = flowDirection;
118-
}
119-
120-
var handler = await CreateHandlerAsync<EditorHandler>(editor);
121-
var nativeAlignment = await contentPage.Dispatcher.DispatchAsync(() =>
122-
{
123-
var textField = GetPlatformControl(handler);
124-
return textField.TextAlignment;
125-
});
126-
127-
Assert.Equal(expectedAlignment, nativeAlignment);
128-
}
12997
}
13098
}

src/Controls/tests/DeviceTests/Elements/Entry/EntryTests.Android.cs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Threading.Tasks;
33
using AndroidX.AppCompat.Widget;
44
using Microsoft.Maui.Controls;
5-
using Microsoft.Maui.Dispatching;
65
using Microsoft.Maui.Handlers;
76
using Xunit;
87

@@ -156,35 +155,5 @@ public async Task RotationConsistent()
156155
var platformRotation = await InvokeOnMainThreadAsync(() => platformEntry.Rotation);
157156
Assert.Equal(expected, platformRotation);
158157
}
159-
160-
[Theory]
161-
[InlineData(true, FlowDirection.LeftToRight, Android.Views.TextAlignment.ViewStart)]
162-
[InlineData(true, FlowDirection.RightToLeft, Android.Views.TextAlignment.ViewStart)]
163-
[InlineData(false, FlowDirection.LeftToRight, Android.Views.TextAlignment.ViewStart)]
164-
[InlineData(false, FlowDirection.RightToLeft, Android.Views.TextAlignment.ViewStart)]
165-
[Description("The Entry's text alignment should match the expected alignment when FlowDirection is applied explicitly or implicitly")]
166-
public async Task EntryAlignmentMatchesFlowDirection(bool isExplicit, FlowDirection flowDirection, Android.Views.TextAlignment expectedAlignment)
167-
{
168-
var entry = new Entry { Text = "Checking flow direction", HorizontalTextAlignment = TextAlignment.Start };
169-
var contentPage = new ContentPage { Title = "Flow Direction", Content = entry };
170-
171-
if (isExplicit)
172-
{
173-
entry.FlowDirection = flowDirection;
174-
}
175-
else
176-
{
177-
contentPage.FlowDirection = flowDirection;
178-
}
179-
180-
var handler = await CreateHandlerAsync<EntryHandler>(entry);
181-
var nativeAlignment = await contentPage.Dispatcher.DispatchAsync(() =>
182-
{
183-
var textField = GetPlatformControl(handler);
184-
return textField.TextAlignment;
185-
});
186-
187-
Assert.Equal(expectedAlignment, nativeAlignment);
188-
}
189158
}
190159
}
Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
#nullable enable
2-
using Xunit;
3-
using System.ComponentModel;
42
using System.Threading.Tasks;
5-
using Microsoft.Maui.Controls;
6-
using Microsoft.Maui.Dispatching;
73
using Microsoft.Maui.Handlers;
84
using Microsoft.UI.Xaml.Controls;
9-
using WTextAlignment = Microsoft.UI.Xaml.TextAlignment;
105

116
namespace Microsoft.Maui.DeviceTests
127
{
@@ -37,60 +32,5 @@ static int GetPlatformCursorPosition(EntryHandler entryHandler) =>
3732

3833
static int GetPlatformSelectionLength(EntryHandler entryHandler) =>
3934
GetPlatformControl(entryHandler).SelectionLength;
40-
41-
public async Task<WTextAlignment> EntryAlignmentMatchesFlowDirection(bool isExplicit, FlowDirection flowDirection)
42-
{
43-
var entry = new Entry { Text = "Checking flow direction", HorizontalTextAlignment = TextAlignment.Start };
44-
var contentPage = new ContentPage { Title = "Flow Direction", Content = entry };
45-
46-
if (isExplicit)
47-
{
48-
entry.FlowDirection = flowDirection;
49-
}
50-
else
51-
{
52-
contentPage.FlowDirection = flowDirection;
53-
}
54-
55-
var handler = await CreateHandlerAsync<EntryHandler>(entry);
56-
var nativeAlignment = await contentPage.Dispatcher.DispatchAsync(() =>
57-
{
58-
var textField = GetPlatformControl(handler);
59-
return textField.TextAlignment;
60-
});
61-
return nativeAlignment;
62-
}
63-
64-
[Fact]
65-
[Description("The Entry's text alignment should match the expected alignment when FlowDirection is explicitly set to LeftToRight.")]
66-
public async Task EntryAlignmentMatchesFlowDirectionLtrExplicit()
67-
{
68-
var results = await EntryAlignmentMatchesFlowDirection(true, FlowDirection.LeftToRight);
69-
Assert.Equal(WTextAlignment.Left, results);
70-
}
71-
72-
[Fact]
73-
[Description("The Entry's text alignment should match the expected alignment when FlowDirection is explicitly set to RightToLeft.")]
74-
public async Task EntryAlignmentMatchesFlowDirectionRtlExplicit()
75-
{
76-
var results = await EntryAlignmentMatchesFlowDirection(true, FlowDirection.RightToLeft);
77-
Assert.Equal(WTextAlignment.Left, results);
78-
}
79-
80-
[Fact]
81-
[Description("The Entry's text alignment should match the expected alignment when FlowDirection is implicitly set to LeftToRight.")]
82-
public async Task EntryAlignmentMatchesFlowDirectionLtrImplicit()
83-
{
84-
var results = await EntryAlignmentMatchesFlowDirection(false, FlowDirection.LeftToRight);
85-
Assert.Equal(WTextAlignment.Left, results);
86-
}
87-
88-
[Fact]
89-
[Description("The Entry's text alignment should match the expected alignment when FlowDirection is implicitly set to RightToLeft.")]
90-
public async Task EntryAlignmentMatchesFlowDirectionRtlImplicit()
91-
{
92-
var results = await EntryAlignmentMatchesFlowDirection(false, FlowDirection.RightToLeft);
93-
Assert.Equal(WTextAlignment.Left, results);
94-
}
9535
}
9636
}

src/Controls/tests/DeviceTests/Elements/Entry/EntryTests.iOS.cs

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
using UIKit;
2-
using Xunit;
3-
using System.ComponentModel;
4-
using System.Linq;
1+
using System.Linq;
52
using System.Threading.Tasks;
63
using Microsoft.Maui.Controls;
74
using Microsoft.Maui.Controls.Handlers.Compatibility;
85
using Microsoft.Maui.DeviceTests.TestCases;
9-
using Microsoft.Maui.Dispatching;
106
using Microsoft.Maui.Handlers;
117
using Microsoft.Maui.Hosting;
128
using Microsoft.Maui.Platform;
9+
using UIKit;
10+
using Xunit;
1311
using static Microsoft.Maui.DeviceTests.AssertHelpers;
1412

1513
namespace Microsoft.Maui.DeviceTests
@@ -325,34 +323,5 @@ await CreateHandlerAndAddToWindow(contentPage, async () =>
325323
});
326324
}
327325
}
328-
329-
[Theory]
330-
[InlineData(true, FlowDirection.LeftToRight, UITextAlignment.Left)]
331-
[InlineData(true, FlowDirection.RightToLeft, UITextAlignment.Right)]
332-
[InlineData(false, FlowDirection.LeftToRight, UITextAlignment.Left)]
333-
[Description("The Entry's text alignment should match the expected alignment when FlowDirection is applied explicitly or implicitly")]
334-
public async Task EntryAlignmentMatchesFlowDirection(bool isExplicit, FlowDirection flowDirection, UITextAlignment expectedAlignment)
335-
{
336-
var entry = new Entry { Text = "Checking flow direction", HorizontalTextAlignment = TextAlignment.Start };
337-
var contentPage = new ContentPage { Title = "Flow Direction", Content = entry };
338-
339-
if (isExplicit)
340-
{
341-
entry.FlowDirection = flowDirection;
342-
}
343-
else
344-
{
345-
contentPage.FlowDirection = flowDirection;
346-
}
347-
348-
var handler = await CreateHandlerAsync<EntryHandler>(entry);
349-
var nativeAlignment = await contentPage.Dispatcher.DispatchAsync(() =>
350-
{
351-
var textField = GetPlatformControl(handler);
352-
return textField.TextAlignment;
353-
});
354-
355-
Assert.Equal(expectedAlignment, nativeAlignment);
356-
}
357326
}
358327
}

0 commit comments

Comments
 (0)