ronantakizawa/codereview-bench huggingface dataset:
Repository: dotnet/maui
File: src/Core/src/Platform/Android/ImageViewExtensions.cs (C#)

Code before:
using Android.Widget;
using Google.Android.Material.ImageView;

namespace Microsoft.Maui.Platform
{
	public static class ImageViewExtensions
	{
		public static void Clear(this ImageView imageView)
		{
			// stop the animation
			if (imageView.Drawable is IAnimatable animatable)
				animatable.Stop();

			// clear the view and release any bitmaps
			imageView.SetImageResource(global::Android.Resource.Color.Transparent);
		}

		public static void UpdateAspect(this ImageView imageView, IImage image)
		{
			if (image.Aspect == Aspect.AspectFill)
				imageView.SetAdjustViewBounds(false);
			else
				imageView.SetAdjustViewBounds(true);

			imageView.SetScaleType(image.Aspect.ToScaleType());
		}

		public static void UpdateIsAnimationPlaying(this ImageView imageView, IImageSourcePart image) =>
			imageView.Drawable.UpdateIsAnimationPlaying(image);

		public static void UpdateIsAnimationPlaying(this Drawable? drawable, IImageSourcePart image)
		{
			if (drawable.IsAlive() && drawable.AsAnimatable() is IAnimatable animatable)
			{
				if (image.IsAnimationPlaying)
				{
					if (!animatable.IsRunning)
						animatable.Start();
				}
				else
				{
					if (animatable.IsRunning)
						animatable.Stop();
				}
			}
		}
	}
}

Review comment (suggestion):
nit: Code style for "new code" should be:

```suggestion
			if (image.Aspect == Aspect.AspectFill)
			{			
				imageView.SetAdjustViewBounds(false);
			}
			else
			{
				imageView.SetAdjustViewBounds(true);
			}
```

Code after:
using Android.Widget;
using Google.Android.Material.ImageView;

namespace Microsoft.Maui.Platform
{
	public static class ImageViewExtensions
	{
		public static void Clear(this ImageView imageView)
		{
			// stop the animation
			if (imageView.Drawable is IAnimatable animatable)
				animatable.Stop();

			// clear the view and release any bitmaps
			imageView.SetImageResource(global::Android.Resource.Color.Transparent);
		}

		public static void UpdateAspect(this ImageView imageView, IImage image)
		{
			if (image.Aspect == Aspect.AspectFill)
			{
				imageView.SetAdjustViewBounds(false);
			}
			else
			{
				imageView.SetAdjustViewBounds(true);
			}

			imageView.SetScaleType(image.Aspect.ToScaleType());
		}

		public static void UpdateIsAnimationPlaying(this ImageView imageView, IImageSourcePart image) =>
			imageView.Drawable.UpdateIsAnimationPlaying(image);

		public static void UpdateIsAnimationPlaying(this Drawable? drawable, IImageSourcePart image)
		{
			if (drawable.IsAlive() && drawable.AsAnimatable() is IAnimatable animatable)
			{
				if (image.IsAnimationPlaying)
				{
					if (!animatable.IsRunning)
						animatable.Start();
				}
				else
				{
					if (animatable.IsRunning)
						animatable.Stop();
				}
			}
		}
	}
Repository: dotnet/maui
File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25558.cs (C#)

Code before:
﻿using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue25558 : _IssuesUITest
{
	public override string Issue => "ImageButton dosen't scale Image correctly";

	public Issue25558(TestDevice device) : base(device)
	{
	}

	[Test]
	[Category(UITestCategories.ImageButton)]
	public void Issue25558VerifyImageButtonAspects()
	{
		App.WaitForElement("imageButton");
		VerifyScreenshot();
	}
}

Review comment (bug):
This test is failing on Windows:
```
   at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2367
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2384
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 665
   at Microsoft.Maui.TestCases.Tests.Issues.Issue25558.Issue25558VerifyImageButtonAspects() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25558.cs:line 19
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
```

Code after:
﻿using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue25558 : _IssuesUITest
{
	public override string Issue => "ImageButton does not scale Image correctly";

	public Issue25558(TestDevice device) : base(device)
	{
	}

	[Test]
	[Category(UITestCategories.ImageButton)]
	public void Issue25558VerifyImageButtonAspects()
	{
		App.WaitForElement("imageButton");
		VerifyScreenshot();
	}
}
Repository: dotnet/maui
File: src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs (C#)

Code before:

			if (disposing && _appeared)
			{
				PageController.SendDisappearing();

				_appeared = false;
			}
		}

		protected virtual void OnElementChanged(VisualElementChangedEventArgs e)
		{
			ElementChanged?.Invoke(this, e);
		}

		protected virtual async Task<bool> OnPopToRoot(Page page, bool animated)
		{
			_ignorePopCall = true;
			_ = page.ToPlatform(MauiContext);
			var renderer = (IPlatformViewHandler)page.Handler;
			if (renderer == null || renderer.ViewController == null)
				return false;

			var task = GetAppearedOrDisappearedTask(page);

			var poppedControllers = PopToRootViewController(animated);

			_ignorePopCall = false;
			var success = !await task;

			if (poppedControllers is not null)
			{
				foreach (var poppedController in poppedControllers)
				{
					if (poppedController is ParentingViewController parentingViewController)
					{
						parentingViewController.Disconnect(false);
					}
					else
					{
						poppedController?.Dispose();
					}
				}
			}

			UpdateToolBarVisible();
			return success;
		}

		protected virtual async Task<bool> OnPopViewAsync(Page page, bool animated)
		{
			if (_ignorePopCall)

Review comment (suggestion):
A this point, this method should be responsible for managing the cleanup of the ViewController that is currently at the top of the view controller stack. It ensures proper disposal of resources if the user action leads to a view being removed from the visual stack. I think inside this method, we should ensure we dispose the TitleView if exists.

Something like:
`NavigationItem.TitleView.Dispose();`

Code after:
			base.Dispose(disposing);

			if (disposing && _appeared)
			{
				PageController.SendDisappearing();

				_appeared = false;
			}
		}

		protected virtual void OnElementChanged(VisualElementChangedEventArgs e)
		{
			ElementChanged?.Invoke(this, e);
		}

		protected virtual async Task<bool> OnPopToRoot(Page page, bool animated)
		{
			_ignorePopCall = true;
			_ = page.ToPlatform(MauiContext);
			var renderer = (IPlatformViewHandler)page.Handler;
			if (renderer == null || renderer.ViewController == null)
				return false;

			var task = GetAppearedOrDisappearedTask(page);

			var poppedControllers = PopToRootViewController(animated);

			_ignorePopCall = false;
			var success = !await task;

			if (poppedControllers is not null)
			{
				foreach (var poppedController in poppedControllers)
				{
					if (poppedController is ParentingViewController parentingViewController)
					{
						parentingViewController.Disconnect(false);
					}
					else
					{
						poppedController?.Dispose();
					}
				}
			}

			UpdateToolBarVisible();
			return success;
		}

		protected virtual async Task<bool> OnPopViewAsync(Page page, bool animated)
		{
Repository: dotnet/maui
File: src/Core/src/Handlers/WebView/WebViewHandler.iOS.cs (C#)

Code before:
			catch (Exception exc)
			{
				handler.MauiContext?.CreateLogger<WebViewHandler>()?.LogWarning(exc, "Syncing Existing Cookies Failed");
			}

			if (handler.PlatformView.NavigationDelegate is MauiWebViewNavigationDelegate mauiDelegate)
				mauiDelegate.CurrentNavigationEvent = WebNavigationEvent.Refresh;

			handler.PlatformView?.UpdateReload(webView);
		}

		public static void MapEval(IWebViewHandler handler, IWebView webView, object? arg)
		{
			if (arg is not string script)
				return;

			handler.PlatformView?.Eval(webView, script);
		}

		public override Size GetDesiredSize(double widthConstraint, double heightConstraint)
		{
			var size = base.GetDesiredSize(widthConstraint, heightConstraint);

			var set = false;

			var width = size.Width;
			var height = size.Height;

			if (size.Width == 0)
			{
				if (widthConstraint <= 0 || double.IsInfinity(widthConstraint))
				{
					width = MinimumSize;
					set = true;
				}
			}

			if (size.Height == 0)
			{
				if (heightConstraint <= 0 || double.IsInfinity(heightConstraint))
				{
					height = MinimumSize;
					set = true;
				}
			}

			if (set)
				size = new Size(width, height);

			return size;
		}

Review comment (suggestion):
With this changes, the next conditions like:

`if (size.Width == 0)`

can use directly the `width` variable.

Code after:
			catch (Exception exc)
			{
				handler.MauiContext?.CreateLogger<WebViewHandler>()?.LogWarning(exc, "Syncing Existing Cookies Failed");
			}

			if (handler.PlatformView.NavigationDelegate is MauiWebViewNavigationDelegate mauiDelegate)
				mauiDelegate.CurrentNavigationEvent = WebNavigationEvent.Refresh;

			handler.PlatformView?.UpdateReload(webView);
		}

		public static void MapEval(IWebViewHandler handler, IWebView webView, object? arg)
		{
			if (arg is not string script)
				return;

			handler.PlatformView?.Eval(webView, script);
		}

		public override Size GetDesiredSize(double widthConstraint, double heightConstraint)
		{
			var size = base.GetDesiredSize(widthConstraint, heightConstraint);

			var set = false;

			var width = size.Width;
			var height = size.Height;

			if (width == 0)
			{
				if (widthConstraint <= 0 || double.IsInfinity(widthConstraint))
				{
					width = MinimumSize;
					set = true;
				}
			}

			if (height == 0)
			{
				if (heightConstraint <= 0 || double.IsInfinity(heightConstraint))
				{
					height = MinimumSize;
					set = true;
				}
			}

			if (set)
				size = new Size(width, height);

			return size;
		}
Repository: dotnet/maui
File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29170.cs (C#)

Code before:
﻿#if IOS
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

internal class Issue29170 : _IssuesUITest
{
	public Issue29170(TestDevice device) : base(device) { }

	public override string Issue => "First Item in CollectionView Overlaps in FlyoutPage.Flyout on iOS";

	[Test]
	[Category(UITestCategories.FlyoutPage)]
	public void CollectionViewFirstItemShouldNotOverlapWithSafeAreaInFlyoutMenu()
	{
		App.WaitForElement("FlyoutButton").Tap();
		Assert.That(App.WaitForElement("CollectionView").GetRect().Y, Is.GreaterThanOrEqualTo(69), 
            "CollectionView Y position should be at least 69 to avoid overlapping with safe area");
	}
}
#endif


Review comment (bug):
This test is failing on iOS:

```
CollectionView Y position should be at least 69 to avoid overlapping with safe area
Assert.That(App.WaitForElement("CollectionView").GetRect().Y, Is.GreaterThanOrEqualTo(69))
Expected: greater than or equal to 69
But was:  54
```


Code after:
﻿#if IOS //iOS only support the SetUseSafeArea
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

internal class Issue29170 : _IssuesUITest
{
	public Issue29170(TestDevice device) : base(device) { }

	public override string Issue => "First Item in CollectionView Overlaps in FlyoutPage.Flyout on iOS";

	[Test]
	[Category(UITestCategories.FlyoutPage)]
	public void CollectionViewFirstItemShouldNotOverlapWithSafeAreaInFlyoutMenu()
	{
		// Use 44 (status bar height) as conservative minimum instead of device-specific value
		// This prevents test flakiness across different simulators and iOS versions
		const int MinimumSafeAreaHeight = 44;
		
		Assert.That(App.WaitForElement("CollectionViewDetail").GetRect().Y, Is.GreaterThanOrEqualTo(MinimumSafeAreaHeight), 
            $"CollectionView Y position should be at least {MinimumSafeAreaHeight} to avoid overlapping with safe area");
		App.WaitForElement("FlyoutButton").Tap();
		Assert.That(App.WaitForElement("CollectionViewFlyout").GetRect().Y, Is.GreaterThanOrEqualTo(MinimumSafeAreaHeight), 
            $"CollectionView Y position should be at least {MinimumSafeAreaHeight} to avoid overlapping with safe area");
	}
}
#endif
Repository: dotnet/maui
File: src/Controls/tests/TestCases.HostApp/Issues/Issue29130.cs (C#)

Code before:

		};
		measureAllItemsButton.Clicked += OnMeasureItemButtonClicked;

		var grid = new Grid
		{
			AutomationId = "29130Grid",
			ColumnDefinitions = new ColumnDefinitionCollection
			{
				new ColumnDefinition { Width = GridLength.Auto },
				new ColumnDefinition { Width = GridLength.Auto }
			}
		};

		// Add buttons to the grid with correct column assignments
		Grid.SetColumn(measureFirstItemButton, 0);
		Grid.SetColumn(measureAllItemsButton, 1);

		grid.Children.Add(measureFirstItemButton);
		grid.Children.Add(measureAllItemsButton);

		collectionView = new CollectionView2
		{
			Margin = new Thickness(0, 20, 0, 0),
			AutomationId = "29130CollectionView",
			ItemSizingStrategy = ItemSizingStrategy.MeasureFirstItem,
			ItemTemplate = new DataTemplate(() =>
			{
				var label = new Label();
				label.SetBinding(Label.TextProperty, "Text");
				label.SetBinding(Label.FontSizeProperty, "FontSize");
				label.SetBinding(Label.AutomationIdProperty, "AutomationId");
				return label;
			})
		};
		collectionView.SetBinding(ItemsView.ItemsSourceProperty, "Items");

		var stackLayout = new StackLayout
		{
			Padding = 10,
			Children =
			{
				grid,
				collectionView
			}
		};

		Content = stackLayout;
	}

	void OnMeasureItemButtonClicked(object sender, EventArgs e)

Review comment (performance):
Could include another Button to change the size of the first item? For example, adding a `Height` property to the ItemModel or changing the `FontSize` property. This should invalidate and re-measure the cache.

Code after:
			AutomationId = "29130MeasureAllItemsButton"

		};
		measureAllItemsButton.Clicked += OnMeasureItemButtonClicked;

		var changeTemplateButton = new Button
		{
			Text = "Change Template",
			AutomationId = "29130ChangeTemplateButton"
		};
		changeTemplateButton.Clicked += OnChangeTemplateButtonClicked;

		var grid = new Grid
		{
			AutomationId = "29130Grid",
			ColumnDefinitions = new ColumnDefinitionCollection
			{
				new ColumnDefinition { Width = GridLength.Star },
				new ColumnDefinition { Width = GridLength.Star },
				new ColumnDefinition { Width = GridLength.Star }
			}
		};

		// Add buttons to the grid with correct column assignments
		Grid.SetColumn(measureFirstItemButton, 0);
		Grid.SetColumn(measureAllItemsButton, 1);
		Grid.SetColumn(changeTemplateButton, 2);

		grid.Children.Add(measureFirstItemButton);
		grid.Children.Add(measureAllItemsButton);
		grid.Children.Add(changeTemplateButton);

		collectionView = new CollectionView2
		{
			Margin = new Thickness(0, 20, 0, 0),
			AutomationId = "29130CollectionView",
			ItemSizingStrategy = ItemSizingStrategy.MeasureFirstItem,
			ItemTemplate = new DataTemplate(() =>
			{
				var label = new Label();
				label.SetBinding(Label.TextProperty, "Text");
				label.SetBinding(Label.FontSizeProperty, "FontSize");
				label.SetBinding(Label.AutomationIdProperty, "AutomationId");
				return label;
			})
		};
		collectionView.SetBinding(ItemsView.ItemsSourceProperty, "Items");

		var stackLayout = new StackLayout
		{
			Padding = 10,
Repository: dotnet/maui
File: src/Controls/tests/TestCases.HostApp/Issues/Issue29961.cs (C#)

Code before:
	Label _convertedImageStatusLabel;
	public Issue29961()
	{
		_convertedImageStatusLabel = new Label
		{
			AutomationId = "ConvertedImageStatusLabel",
			Text = "Result Image Status: "
		};

		VerticalStackLayout VerticalStackLayout = new VerticalStackLayout
		{
			Children =
			{
				CreateButton("Resize", OnResize),
				_convertedImageStatusLabel
			}
		};

		Content = new ScrollView { Content = VerticalStackLayout };
	}

	Button CreateButton(string text, EventHandler handler)
	{
		Button button = new Button
		{
			AutomationId = $"Issue21886_1ResizeBtn",
			Text = text,
			HorizontalOptions = LayoutOptions.Fill
		};

		button.Clicked += handler;
		return button;
	}

	async Task<IImage> LoadImageAsync()
	{
		var assembly = GetType().GetTypeInfo().Assembly;
		using var stream = assembly.GetManifestResourceStream("Controls.TestCases.HostApp.Resources.Images.royals.png");
		return await Task.FromResult(PlatformImage.FromStream(stream));
	}

	async void OnResize(object sender, EventArgs e)
	{
		var image = await LoadImageAsync();
		var res = image.Resize(10, 10, ResizeMode.Fit, true);

		UpdateStatusLabels(res);
	}

	void UpdateStatusLabels(IImage resultImage)
	{

Review comment (refactor):
This AutomationId looks like duplicated, could you use the issue identifier number?
`Issue29961_ResizeBtn`

Code after:
	Label _convertedImageStatusLabel;
	public Issue29961()
	{
		_convertedImageStatusLabel = new Label
		{
			AutomationId = "ConvertedImageStatusLabel",
			Text = "Result Image Status: "
		};

		VerticalStackLayout VerticalStackLayout = new VerticalStackLayout
		{
			Children =
			{
				CreateButton("Resize", OnResize),
				_convertedImageStatusLabel
			}
		};

		Content = new ScrollView { Content = VerticalStackLayout };
	}

	Button CreateButton(string text, EventHandler handler)
	{
		Button button = new Button
		{
			AutomationId = $"Issue29961_ResizeBtn",
			Text = text,
			HorizontalOptions = LayoutOptions.Fill
		};

		button.Clicked += handler;
		return button;
	}

	async Task<IImage> LoadImageAsync()
	{
		var assembly = GetType().GetTypeInfo().Assembly;
		using var stream = assembly.GetManifestResourceStream("Controls.TestCases.HostApp.Resources.Images.royals.png");
		return await Task.FromResult(PlatformImage.FromStream(stream));
	}

	async void OnResize(object sender, EventArgs e)
	{
		var image = await LoadImageAsync();
		var res = image.Resize(10, 10, ResizeMode.Fit, true);

		UpdateStatusLabels(res);
	}

	void UpdateStatusLabels(IImage resultImage)
	{
Repository: dotnet/maui
File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17010.cs (C#)

Code before:
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue17010 : _IssuesUITest
{
	public Issue17010(TestDevice device) : base(device)
	{
	}

	public override string Issue => "Unable to Update iOS SwipeGesture Direction at Runtime";

	[Test]
	[Category(UITestCategories.Gestures)]
	public void SwipeGestureDirectionShouldChangeAtRuntime()
	{
		Assert.That(App.WaitForElement("DirectionLabel").GetText(), Is.EqualTo("Direction: Right"));
		
		App.SwipeLeftToRight("DirectionLabel");
		Assert.That(App.WaitForElement("DirectionLabel").GetText(), Is.EqualTo("Direction: Left"));

		App.SwipeRightToLeft("DirectionLabel");
		Assert.That(App.WaitForElement("DirectionLabel").GetText(), Is.EqualTo("Direction: Right"));
	}
}


Review comment (bug):
The test is failing on Catalyst:
```
Assert.That(App.WaitForElement("DirectionLabel").GetText(), Is.EqualTo("Direction: Left"))
Expected string length 15 but was 16. Strings differ at index 11.
Expected: "Direction: Left"
But was:  "Direction: Right"
----------------------^
```

Code after:
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue17010 : _IssuesUITest
{
	public Issue17010(TestDevice device) : base(device)
	{
	}

	public override string Issue => "Unable to Update iOS SwipeGesture Direction at Runtime";

	[Test]
	[Category(UITestCategories.Gestures)]
	public void SwipeGestureDirectionShouldChangeAtRuntime()
	{
		Assert.That(App.WaitForElement("DirectionLabel").GetText(), Is.EqualTo("Direction: Right"));
		
		App.SwipeLeftToRight("DirectionLabel");
		Assert.That(App.WaitForElement("DirectionLabel").GetText(), Is.EqualTo("Direction: Left"));

		App.SwipeRightToLeft("DirectionLabel");
		Assert.That(App.WaitForElement("DirectionLabel").GetText(), Is.EqualTo("Direction: Right"));
	}
}
Repository: dotnet/maui
File: src/Controls/tests/TestCases.HostApp/Issues/Issue18420.cs (C#)

Code before:
﻿namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 18420, "[Windows]ViewExtensions RotateYTo and RotateXTo with length 0 crashes on Windows", PlatformAffected.UWP)]
public class Issue18420 : ContentPage
{
	int count = 0;
	Button rotateButton;
	public Issue18420()
	{
		var layout = new VerticalStackLayout
		{
			Spacing = 25,
			Padding = new Thickness(30, 0),
			VerticalOptions = LayoutOptions.Center
		};

		rotateButton = new Button
		{
			Text = "Click me to rotate",
			BackgroundColor= Colors.Red,
			HorizontalOptions = LayoutOptions.Center,
			AutomationId= "RotateButton"
		};

		rotateButton.Clicked += OnRotateButtonClicked;
		layout.Children.Add(rotateButton);
		this.Content = layout;
	}

Review comment (bug):
```suggestion
[Issue(IssueTracker.Github, 18420, "[Windows] ViewExtensions RotateYTo and RotateXTo with length 0 crashes on Windows", PlatformAffected.UWP)]
```

Code after:
﻿namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 18420, "[Windows] ViewExtensions RotateYTo and RotateXTo with length 0 crashes on Windows", PlatformAffected.UWP)]
public class Issue18420 : ContentPage
{
	int count = 0;
	Button rotateButton;
	public Issue18420()
	{
		var layout = new VerticalStackLayout
		{
			Spacing = 25,
			Padding = new Thickness(30, 0),
			VerticalOptions = LayoutOptions.Center
		};

		rotateButton = new Button
		{
			Text = "Click me to rotate",
			BackgroundColor= Colors.Red,
			HorizontalOptions = LayoutOptions.Center,
			AutomationId= "RotateButton"
		};

		rotateButton.Clicked += OnRotateButtonClicked;
		layout.Children.Add(rotateButton);
		this.Content = layout;
	}
Repository: dotnet/maui
File: src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18420.cs (C#)

Code before:
﻿using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue18420 : _IssuesUITest
{
	public Issue18420(TestDevice device) : base(device) { }

	public override string Issue => "[Windows]ViewExtensions RotateYTo and RotateXTo with length 0 crashes on Windows";

	[Test]
	[Category(UITestCategories.ViewBaseTests)]
	public void ApplyingRotationWithZeroDurationShouldNotCrash()
	{
		App.WaitForElement("RotateButton");
		App.Tap("RotateButton");
		App.Tap("RotateButton");
		App.Tap("RotateButton");
		App.WaitForElement("RotateButton");
	}
}

Review comment (bug):
```suggestion
	public override string Issue => "[Windows] ViewExtensions RotateYTo and RotateXTo with length 0 crashes on Windows";
```

Code after:
﻿using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue18420 : _IssuesUITest
{
	public Issue18420(TestDevice device) : base(device) { }

	public override string Issue => "[Windows] ViewExtensions RotateYTo and RotateXTo with length 0 crashes on Windows";

	[Test]
	[Category(UITestCategories.ViewBaseTests)]
	public void ApplyingRotationWithZeroDurationShouldNotCrash()
	{
		App.WaitForElement("RotateButton");
		App.Tap("RotateButton");
		App.Tap("RotateButton");
		App.Tap("RotateButton");
		App.WaitForElement("RotateButton");
	}
}