From 8f32269d416ea06f070f60ad40f951b5d09eef25 Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Tue, 14 Jan 2025 15:57:42 +0100 Subject: [PATCH 1/5] Enable running compat unit tests for iOS & Android --- eng/cake/dotnet.cake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake index 5428709c90c3..695c7516ed33 100644 --- a/eng/cake/dotnet.cake +++ b/eng/cake/dotnet.cake @@ -266,6 +266,8 @@ Task("dotnet-test") "**/Resizetizer.UnitTests.csproj", "**/Graphics.Tests.csproj", "**/Compatibility.Core.UnitTests.csproj", + "**/Compatibility.iOS.UnitTests.csproj", + "**/Compatibility.Android.UnitTests.csproj", }; var success = true; From a03d1919a897b0cab02807cdd39dc7f2211d547b Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Wed, 15 Jan 2025 09:00:01 +0100 Subject: [PATCH 2/5] Remove unavailable references --- .../iOS/Compatibility.iOS.UnitTests.csproj | 5 - .../Core/tests/iOS/RotationTests.cs | 2 - .../Core/tests/iOS/ScaleTests.cs | 2 - .../Core/tests/iOS/ShapeTests.cs | 2 - .../tests/iOS/Utilities/NumericExtensions.cs | 168 ++++++++++++++++++ .../Core/tests/iOS/Utilities/ParsingUtils.cs | 77 ++++++++ 6 files changed, 245 insertions(+), 11 deletions(-) create mode 100644 src/Compatibility/Core/tests/iOS/Utilities/NumericExtensions.cs create mode 100644 src/Compatibility/Core/tests/iOS/Utilities/ParsingUtils.cs diff --git a/src/Compatibility/Core/tests/iOS/Compatibility.iOS.UnitTests.csproj b/src/Compatibility/Core/tests/iOS/Compatibility.iOS.UnitTests.csproj index 970a574cc756..f00226168701 100644 --- a/src/Compatibility/Core/tests/iOS/Compatibility.iOS.UnitTests.csproj +++ b/src/Compatibility/Core/tests/iOS/Compatibility.iOS.UnitTests.csproj @@ -19,9 +19,4 @@ - - - - - \ No newline at end of file diff --git a/src/Compatibility/Core/tests/iOS/RotationTests.cs b/src/Compatibility/Core/tests/iOS/RotationTests.cs index c92d2b01921d..82de54e14d3a 100644 --- a/src/Compatibility/Core/tests/iOS/RotationTests.cs +++ b/src/Compatibility/Core/tests/iOS/RotationTests.cs @@ -1,8 +1,6 @@ using System.Collections; using System.Threading.Tasks; using NUnit.Framework; -using static Microsoft.Maui.Controls.Compatibility.UITests.NumericExtensions; -using static Microsoft.Maui.Controls.Compatibility.UITests.ParsingUtils; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS.UnitTests { diff --git a/src/Compatibility/Core/tests/iOS/ScaleTests.cs b/src/Compatibility/Core/tests/iOS/ScaleTests.cs index 73e0fc4f5f82..b3d87aab025a 100644 --- a/src/Compatibility/Core/tests/iOS/ScaleTests.cs +++ b/src/Compatibility/Core/tests/iOS/ScaleTests.cs @@ -1,8 +1,6 @@ using System.Collections; using System.Threading.Tasks; using NUnit.Framework; -using static Microsoft.Maui.Controls.Compatibility.UITests.NumericExtensions; -using static Microsoft.Maui.Controls.Compatibility.UITests.ParsingUtils; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS.UnitTests { diff --git a/src/Compatibility/Core/tests/iOS/ShapeTests.cs b/src/Compatibility/Core/tests/iOS/ShapeTests.cs index 99afb47310a7..77d1835a5eea 100644 --- a/src/Compatibility/Core/tests/iOS/ShapeTests.cs +++ b/src/Compatibility/Core/tests/iOS/ShapeTests.cs @@ -3,8 +3,6 @@ using NUnit.Framework; using ObjCRuntime; using UIKit; -using static Microsoft.Maui.Controls.Compatibility.UITests.NumericExtensions; -using static Microsoft.Maui.Controls.Compatibility.UITests.ParsingUtils; using CategoryAttribute = NUnit.Framework.CategoryAttribute; namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS.UnitTests diff --git a/src/Compatibility/Core/tests/iOS/Utilities/NumericExtensions.cs b/src/Compatibility/Core/tests/iOS/Utilities/NumericExtensions.cs new file mode 100644 index 000000000000..f92054424f7f --- /dev/null +++ b/src/Compatibility/Core/tests/iOS/Utilities/NumericExtensions.cs @@ -0,0 +1,168 @@ +using System; + +namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS.UnitTests +{ + internal class Matrix : Object + { + public double M00, M01, M02, M03; + public double M10, M11, M12, M13; + public double M20, M21, M22, M23; + public double M30, M31, M32, M33; + + public void Log() + { + + //Logger.LogLine (); + + //Logger.LogLine (string.Format ("{0,-3}, {1,-3}, {2,-3}, {3,-3}", M00, M01, M02, M03)); + //Logger.LogLine (string.Format ("{0,-3}, {1,-3}, {2,-3}, {3,-3}", M10, M11, M12, M13)); + //Logger.LogLine (string.Format ("{0,-3}, {1,-3}, {2,-3}, {3,-3}", M20, M21, M22, M23)); + //Logger.LogLine (string.Format ("{0,-3}, {1,-3}, {2,-3}, {3,-3}", M30, M31, M32, M33)); + + //Logger.LogLine (); + } + + public override bool Equals(object obj) + { + if (obj == null) + return false; + + var transform = obj as Matrix; + if (transform is null) + return false; + + const double tolerance = 0.01; + bool result = + Math.Abs(M00 - transform.M00) < tolerance && + Math.Abs(M01 - transform.M01) < tolerance && + Math.Abs(M02 - transform.M02) < tolerance && + Math.Abs(M03 - transform.M03) < tolerance && + Math.Abs(M10 - transform.M10) < tolerance && + Math.Abs(M11 - transform.M11) < tolerance && + Math.Abs(M12 - transform.M12) < tolerance && + Math.Abs(M13 - transform.M13) < tolerance && + Math.Abs(M20 - transform.M20) < tolerance && + Math.Abs(M21 - transform.M21) < tolerance && + Math.Abs(M22 - transform.M22) < tolerance && + Math.Abs(M23 - transform.M23) < tolerance && + Math.Abs(M30 - transform.M30) < tolerance && + Math.Abs(M31 - transform.M31) < tolerance && + Math.Abs(M32 - transform.M32) < tolerance && + Math.Abs(M33 - transform.M33) < tolerance; + + return result; + } + + public override int GetHashCode() + { + return 0; + } + } + + internal enum Axis + { + X, + Y, + Z + } + + internal static class NumericExtensions + { + public static double ToRadians(this float val) + { + return (Math.PI / 180.0) * val; + } + + public static Matrix CalculateRotationMatrixForDegrees(float degrees, Axis rotationAxis) + { + var angle = degrees.ToRadians(); + + var transform = new Matrix(); + if (rotationAxis == Axis.X) + { + transform.M00 = 1; + transform.M01 = 0; + transform.M02 = 0; + transform.M03 = 0; + transform.M10 = 0; + transform.M11 = (float)Math.Cos(angle); + transform.M12 = (float)Math.Sin(angle); + transform.M13 = 0; + transform.M20 = 0; + transform.M21 = -(float)Math.Sin(angle); + transform.M22 = (float)Math.Cos(angle); + transform.M23 = 0; + transform.M30 = 0; + transform.M31 = 0; + transform.M32 = 0; + transform.M33 = 1; + } + else if (rotationAxis == Axis.Y) + { + transform.M00 = (float)Math.Cos(angle); + transform.M01 = 0; + transform.M02 = -(float)Math.Sin(angle); + transform.M03 = 0; + transform.M10 = 0; + transform.M11 = 1; + transform.M12 = 0; + transform.M13 = 0; + transform.M20 = (float)Math.Sin(angle); + transform.M21 = 0; + transform.M22 = (float)Math.Cos(angle); + transform.M23 = 0; + transform.M30 = 0; + transform.M31 = 0; + transform.M32 = 0; + transform.M33 = 1; + } + else + { + transform.M00 = (float)Math.Cos(angle); + transform.M01 = (float)Math.Sin(angle); + transform.M02 = 0; + transform.M03 = 0; + transform.M10 = -(float)Math.Sin(angle); + transform.M11 = (float)Math.Cos(angle); + transform.M12 = 0; + transform.M13 = 0; + transform.M20 = 0; + transform.M21 = 0; + transform.M22 = 1; + transform.M23 = 0; + transform.M30 = 0; + transform.M31 = 0; + transform.M32 = 0; + transform.M33 = 1; + } + + return transform; + } + + public static Matrix BuildScaleMatrix(float scale) + { + var transform = new Matrix(); + + transform.M00 = scale; + transform.M01 = 0; + transform.M02 = 0; + transform.M03 = 0; + transform.M10 = 0; + transform.M11 = scale; + transform.M12 = 0; + transform.M13 = 0; + transform.M20 = 0; + transform.M21 = 0; + transform.M22 = scale; + transform.M23 = 0; + transform.M30 = 0; + transform.M31 = 0; + transform.M32 = 0; + transform.M33 = 1; + + return transform; + } + + } + +} \ No newline at end of file diff --git a/src/Compatibility/Core/tests/iOS/Utilities/ParsingUtils.cs b/src/Compatibility/Core/tests/iOS/Utilities/ParsingUtils.cs new file mode 100644 index 000000000000..c83c3a509665 --- /dev/null +++ b/src/Compatibility/Core/tests/iOS/Utilities/ParsingUtils.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using Microsoft.Maui.Graphics; + +namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS.UnitTests +{ + + internal static class ParsingUtils + { + public static Font ParseUIFont(string font) + { + FontAttributes fontAttrs = FontAttributes.None; + + // Logger.LogLine ("TEST PARSING"); + + if (font.IndexOf("font-weight: bold;", StringComparison.Ordinal) != -1) + { + // Logger.LogLine ("Found Bold"); + fontAttrs = FontAttributes.Bold; + } + + return new Font().WithAttributes(fontAttrs); + } + + public static Color ParseUIColor(string backgroundColor) + { + var delimiters = new char[] { ' ' }; + string[] words = backgroundColor.Split(delimiters, StringSplitOptions.RemoveEmptyEntries); + return new Color(float.Parse(words[1]), float.Parse(words[2]), float.Parse(words[3]), float.Parse(words[4])); + } + + public static Point ParseCGPoint(object CGPoint) + { + var point = new Point { X = 0, Y = 0 }; + return point; + } + + public static Matrix ParseCATransform3D(string CATransform3D) + { + // Logger.Log (CATransform3D); + char[] delimiters = { '[', ' ', ']', ';' }; + string[] words = CATransform3D.Split(delimiters, StringSplitOptions.RemoveEmptyEntries); + + List numbers = new List(); + + // Each number is represented by 2 blocks returned by server + for (int i = 0; i < words.Length; i++) + { + numbers.Add(Convert.ToDouble(words[i])); + } + + var transformationMatrix = new Matrix(); + transformationMatrix.M00 = numbers[0]; + transformationMatrix.M01 = numbers[1]; + transformationMatrix.M02 = numbers[2]; + transformationMatrix.M03 = numbers[3]; + transformationMatrix.M10 = numbers[4]; + transformationMatrix.M11 = numbers[5]; + transformationMatrix.M12 = numbers[6]; + transformationMatrix.M13 = numbers[7]; + transformationMatrix.M20 = numbers[8]; + transformationMatrix.M21 = numbers[9]; + transformationMatrix.M22 = numbers[10]; + transformationMatrix.M23 = numbers[11]; + transformationMatrix.M30 = numbers[12]; + transformationMatrix.M31 = numbers[13]; + transformationMatrix.M32 = numbers[14]; + transformationMatrix.M33 = numbers[15]; + + return transformationMatrix; + } + + } + +} \ No newline at end of file From f815c0eb11339e60bfffe91ba5b876863018aea8 Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Wed, 15 Jan 2025 10:34:11 +0100 Subject: [PATCH 3/5] Update ToolbarExtensionsTests.cs --- .../Core/tests/Android/ToolbarExtensionsTests.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Compatibility/Core/tests/Android/ToolbarExtensionsTests.cs b/src/Compatibility/Core/tests/Android/ToolbarExtensionsTests.cs index ebe9c9e8f108..560167958732 100644 --- a/src/Compatibility/Core/tests/Android/ToolbarExtensionsTests.cs +++ b/src/Compatibility/Core/tests/Android/ToolbarExtensionsTests.cs @@ -127,8 +127,9 @@ public void SecondaryToolbarItemsDontChangeColor() SetupToolBar(settings, MauiContext); AToolBar aToolBar = settings.ToolBar; IMenuItem menuItem = settings.MenuItemsCreated.First(); - +#pragma warning disable XAOBS001 // Type or member is obsolete MenuItemImpl menuItemImpl = (MenuItemImpl)menuItem; +#pragma warning restore XAOBS001 // Type or member is obsolete Assert.IsNotNull(menuItemImpl, "menuItem is not of type MenuItemImpl"); if (menuItemImpl.TitleFormatted is SpannableString tf) @@ -202,9 +203,11 @@ public void Layout(int width = 800, int height = 200) public Color TintColor; public List MenuItemsCreated; +#pragma warning disable XAOBS001 // Type or member is obsolete public IEnumerable TextViews => ToolBar.GetChildrenOfType() .OrderBy(x => x.Text); +#pragma warning restore XAOBS001 // Type or member is obsolete } } } From 32b97eb78e1ccd94b261e1a317ca0c36c5414a10 Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Thu, 16 Jan 2025 09:49:38 +0100 Subject: [PATCH 4/5] Fix RotationTests --- src/Compatibility/Core/tests/iOS/RotationTests.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Compatibility/Core/tests/iOS/RotationTests.cs b/src/Compatibility/Core/tests/iOS/RotationTests.cs index 82de54e14d3a..9e8f430344c8 100644 --- a/src/Compatibility/Core/tests/iOS/RotationTests.cs +++ b/src/Compatibility/Core/tests/iOS/RotationTests.cs @@ -48,8 +48,8 @@ static IEnumerable RotationCases public async Task RotationXConsistent(View view) { var transform = await GetRendererProperty(view, r => r.NativeView.Layer.Transform, requiresLayout: true); - var actual = ParseCATransform3D(transform.ToString()); - var expected = CalculateRotationMatrixForDegrees((float)view.RotationX, UITests.Axis.X); + var actual = ParsingUtils.ParseCATransform3D(transform.ToString()); + var expected = CalculateRotationMatrixForDegrees((float)view.RotationX, Axis.X); Assert.That(actual, Is.EqualTo(expected)); } @@ -58,8 +58,8 @@ public async Task RotationXConsistent(View view) public async Task RotationYConsistent(View view) { var transform = await GetRendererProperty(view, r => r.NativeView.Layer.Transform, requiresLayout: true); - var actual = ParseCATransform3D(transform.ToString()); - var expected = CalculateRotationMatrixForDegrees((float)view.RotationY, UITests.Axis.Y); + var actual = ParsingUtils.ParseCATransform3D(transform.ToString()); + var expected = CalculateRotationMatrixForDegrees((float)view.RotationY, Axis.Y); Assert.That(actual, Is.EqualTo(expected)); } @@ -68,8 +68,8 @@ public async Task RotationYConsistent(View view) public async Task RotationConsistent(View view) { var transform = await GetRendererProperty(view, r => r.NativeView.Layer.Transform, requiresLayout: true); - var actual = ParseCATransform3D(transform.ToString()); - var expected = CalculateRotationMatrixForDegrees((float)view.Rotation, UITests.Axis.Z); + var actual = ParsingUtils.ParseCATransform3D(transform.ToString()); + var expected = CalculateRotationMatrixForDegrees((float)view.Rotation, Axis.Z); Assert.That(actual, Is.EqualTo(expected)); } } From c8f293acb54b0331b32ba164c4f67b72d764a037 Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Thu, 16 Jan 2025 09:56:23 +0100 Subject: [PATCH 5/5] Fix iOS --- src/Compatibility/Core/tests/iOS/BackgroundColorTests.cs | 4 ++++ src/Compatibility/Core/tests/iOS/BackgroundTests.cs | 2 ++ src/Compatibility/Core/tests/iOS/CornerRadiusTests.cs | 3 ++- src/Compatibility/Core/tests/iOS/FrameTests.cs | 8 ++++++-- src/Compatibility/Core/tests/iOS/PlatformTestFixture.cs | 2 ++ src/Compatibility/Core/tests/iOS/RotationTests.cs | 6 +++--- src/Compatibility/Core/tests/iOS/ScaleTests.cs | 4 ++-- 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/Compatibility/Core/tests/iOS/BackgroundColorTests.cs b/src/Compatibility/Core/tests/iOS/BackgroundColorTests.cs index 7e87f1e00c3b..4bf6797a5628 100644 --- a/src/Compatibility/Core/tests/iOS/BackgroundColorTests.cs +++ b/src/Compatibility/Core/tests/iOS/BackgroundColorTests.cs @@ -15,8 +15,10 @@ static IEnumerable TestCases { get { +#pragma warning disable CS0618 // Type or member is obsolete foreach (var element in BasicViews .Where(e => !(e is Label) && !(e is BoxView) && !(e is Frame))) +#pragma warning restore CS0618 // Type or member is obsolete { element.BackgroundColor = Colors.AliceBlue; yield return new TestCaseData(element) @@ -38,7 +40,9 @@ public async Task BackgroundColorConsistent(VisualElement element) [Description("Frame background color should match renderer background color")] public async Task FrameBackgroundColorConsistent() { +#pragma warning disable CS0618 // Type or member is obsolete var frame = new Frame { BackgroundColor = Colors.AliceBlue }; +#pragma warning restore CS0618 // Type or member is obsolete var expectedColor = frame.BackgroundColor.ToPlatform(); var screenshot = await GetRendererProperty(frame, (ver) => ver.NativeView.ToBitmap(), requiresLayout: true); screenshot.AssertColorAtCenter(expectedColor); diff --git a/src/Compatibility/Core/tests/iOS/BackgroundTests.cs b/src/Compatibility/Core/tests/iOS/BackgroundTests.cs index 9cf2fe3562f3..0a369f7e6db4 100644 --- a/src/Compatibility/Core/tests/iOS/BackgroundTests.cs +++ b/src/Compatibility/Core/tests/iOS/BackgroundTests.cs @@ -31,7 +31,9 @@ static LinearGradientBrush LinearGradientBrush [Description("Frame background should match renderer background")] public async Task FrameLinearGradientBrushConsistent() { +#pragma warning disable CS0618 // Type or member is obsolete var frame = new Frame { HeightRequest = 50, WidthRequest = 50, Background = LinearGradientBrush }; +#pragma warning restore CS0618 // Type or member is obsolete var screenshot = await GetRendererProperty(frame, (ver) => ver.NativeView.ToBitmap(), requiresLayout: true); var screenshotHeight = (int)screenshot.Size.Height; diff --git a/src/Compatibility/Core/tests/iOS/CornerRadiusTests.cs b/src/Compatibility/Core/tests/iOS/CornerRadiusTests.cs index 9c881ac1d841..a76d9e1ec8eb 100644 --- a/src/Compatibility/Core/tests/iOS/CornerRadiusTests.cs +++ b/src/Compatibility/Core/tests/iOS/CornerRadiusTests.cs @@ -43,8 +43,9 @@ public async Task ButtonCornerRadius() public async Task FrameCornerRadius() { var backgroundColor = Colors.CadetBlue; - +#pragma warning disable CS0618 // Type or member is obsolete var frame = new Frame +#pragma warning restore CS0618 // Type or member is obsolete { HeightRequest = 100, WidthRequest = 200, diff --git a/src/Compatibility/Core/tests/iOS/FrameTests.cs b/src/Compatibility/Core/tests/iOS/FrameTests.cs index f8e993f2ef3c..88340e1bfc95 100644 --- a/src/Compatibility/Core/tests/iOS/FrameTests.cs +++ b/src/Compatibility/Core/tests/iOS/FrameTests.cs @@ -19,7 +19,9 @@ public class FrameTests : PlatformTestFixture public async Task ReusingFrameRendererDoesCauseOverlapWithPreviousContent() { ContentPage page = new ContentPage(); +#pragma warning disable CS0618 // Type or member is obsolete Frame frame1 = new Frame() +#pragma warning restore CS0618 // Type or member is obsolete { Content = new Label() { @@ -35,8 +37,9 @@ await page.Dispatcher.DispatchAsync(() => using (var renderer = GetRenderer(frame1)) { var frameRenderer = GetRenderer(frame1); - +#pragma warning disable CS0618 // Type or member is obsolete Frame frame2 = new Frame() +#pragma warning restore CS0618 // Type or member is obsolete { Content = new Label() { @@ -70,8 +73,9 @@ await page.Dispatcher.DispatchAsync(() => var uILabel = (UILabel)labelRenderer.NativeView.Subviews[0]; Assert.AreEqual("I am frame 2", uILabel.Text); - +#pragma warning disable CS0618 // Type or member is obsolete Frame frameWithButton = new Frame() +#pragma warning restore CS0618 // Type or member is obsolete { Content = new Button() { diff --git a/src/Compatibility/Core/tests/iOS/PlatformTestFixture.cs b/src/Compatibility/Core/tests/iOS/PlatformTestFixture.cs index a47edcb83cf7..1c6334786d94 100644 --- a/src/Compatibility/Core/tests/iOS/PlatformTestFixture.cs +++ b/src/Compatibility/Core/tests/iOS/PlatformTestFixture.cs @@ -26,7 +26,9 @@ protected static IEnumerable BasicViews yield return new DatePicker { }; yield return new Editor { }; yield return new Entry { }; +#pragma warning disable CS0618 // Type or member is obsolete yield return new Frame { }; +#pragma warning restore CS0618 // Type or member is obsolete yield return new Image { }; yield return new ImageButton { }; yield return new Label { }; diff --git a/src/Compatibility/Core/tests/iOS/RotationTests.cs b/src/Compatibility/Core/tests/iOS/RotationTests.cs index 9e8f430344c8..a3822820d159 100644 --- a/src/Compatibility/Core/tests/iOS/RotationTests.cs +++ b/src/Compatibility/Core/tests/iOS/RotationTests.cs @@ -49,7 +49,7 @@ public async Task RotationXConsistent(View view) { var transform = await GetRendererProperty(view, r => r.NativeView.Layer.Transform, requiresLayout: true); var actual = ParsingUtils.ParseCATransform3D(transform.ToString()); - var expected = CalculateRotationMatrixForDegrees((float)view.RotationX, Axis.X); + var expected = NumericExtensions.CalculateRotationMatrixForDegrees((float)view.RotationX, Axis.X); Assert.That(actual, Is.EqualTo(expected)); } @@ -59,7 +59,7 @@ public async Task RotationYConsistent(View view) { var transform = await GetRendererProperty(view, r => r.NativeView.Layer.Transform, requiresLayout: true); var actual = ParsingUtils.ParseCATransform3D(transform.ToString()); - var expected = CalculateRotationMatrixForDegrees((float)view.RotationY, Axis.Y); + var expected = NumericExtensions.CalculateRotationMatrixForDegrees((float)view.RotationY, Axis.Y); Assert.That(actual, Is.EqualTo(expected)); } @@ -69,7 +69,7 @@ public async Task RotationConsistent(View view) { var transform = await GetRendererProperty(view, r => r.NativeView.Layer.Transform, requiresLayout: true); var actual = ParsingUtils.ParseCATransform3D(transform.ToString()); - var expected = CalculateRotationMatrixForDegrees((float)view.Rotation, Axis.Z); + var expected = NumericExtensions.CalculateRotationMatrixForDegrees((float)view.Rotation, Axis.Z); Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/Compatibility/Core/tests/iOS/ScaleTests.cs b/src/Compatibility/Core/tests/iOS/ScaleTests.cs index b3d87aab025a..9ed97f40bea8 100644 --- a/src/Compatibility/Core/tests/iOS/ScaleTests.cs +++ b/src/Compatibility/Core/tests/iOS/ScaleTests.cs @@ -24,8 +24,8 @@ static IEnumerable ScaleCases public async Task ScaleConsistent(View view) { var transform = await GetRendererProperty(view, r => r.NativeView.Layer.Transform, requiresLayout: true); - var actual = ParseCATransform3D(transform.ToString()); - var expected = BuildScaleMatrix((float)view.Scale); + var actual = ParsingUtils.ParseCATransform3D(transform.ToString()); + var expected = NumericExtensions.BuildScaleMatrix((float)view.Scale); Assert.That(actual, Is.EqualTo(expected)); } }