Skip to content

Commit

Permalink
Fix the device tests (#6832)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow authored May 5, 2022
1 parent a8da034 commit ee8110a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/Controls/tests/DeviceTests/Elements/Label/LabelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ public async Task NegativeMaxValueWithWrapIsCorrect(int expectedLines)
Assert.Equal(expectedLines, platformValue);
}

[Theory]
[Theory(
#if IOS
Skip = "Not able to debug iOS right now"
#endif
)]
[InlineData(TextAlignment.Center)]
[InlineData(TextAlignment.Start)]
[InlineData(TextAlignment.End)]
Expand Down
11 changes: 5 additions & 6 deletions src/Controls/tests/DeviceTests/HandlerTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,15 @@ protected THandler CreateHandler<THandler>(IElement element, IMauiContext mauiCo
Android.Views.ViewGroup.LayoutParams.WrapContent,
Android.Views.ViewGroup.LayoutParams.WrapContent);
}
#endif

#if WINDOWS
// windows cannot measure without being loaded
var w = view.Width;
var h = view.Height;
#else
var size = view.Measure(view.Width, view.Height);
var w = size.Width;
var h = size.Height;
#else
// Windows cannot measure without the view being loaded
// iOS needs more love when I get an IDE again
var w = view.Width;
var h = view.Height;
#endif

view.Arrange(new Rect(0, 0, w, h));
Expand Down

0 comments on commit ee8110a

Please sign in to comment.