public void Border_AntiAlias() { const string firstRectBlueish = "#ffd8d8ff"; const string secondRectBlueish = "#ff9e9eff"; Run("UITests.Windows_UI_Xaml_Controls.BorderTests.BorderAntiAlias"); var firstBorderRect = _app.GetPhysicalRect("firstBorder"); var secondBorderRect = _app.GetPhysicalRect("secondBorder"); using var screenshot = TakeScreenshot(nameof(Border_AntiAlias)); ImageAssert.HasColorInRectangle( screenshot, firstBorderRect.ToRectangle(), ColorCodeParser.Parse(firstRectBlueish) ); ImageAssert.HasPixels( screenshot, ExpectedPixels .At($"top-left", secondBorderRect.X, secondBorderRect.Y) .WithPixelTolerance(1, 1) .Pixel(secondRectBlueish), ExpectedPixels .At($"top-right", secondBorderRect.Right, secondBorderRect.Y) .WithPixelTolerance(1, 1) .Pixel(secondRectBlueish), ExpectedPixels .At($"bottom-right", secondBorderRect.Right, secondBorderRect.Bottom) .WithPixelTolerance(1, 1) .Pixel(secondRectBlueish), ExpectedPixels .At($"bottom-left", secondBorderRect.X, secondBorderRect.Bottom) .WithPixelTolerance(1, 1) .Pixel(secondRectBlueish) ); }
private void Assert(float x, float y, string color) => Assert(x, y, ColorCodeParser.Parse(color));
public static void DoesNotHaveColorAt(FileInfo screenshot, float x, float y, string excludedColorCode, byte tolerance = 0, [CallerLineNumber] int line = 0) => DoesNotHaveColorAtImpl(screenshot, (int)x, (int)y, ColorCodeParser.Parse(excludedColorCode), tolerance, line);
public static void DoesNotHaveColorAt(FileInfo screenshot, float x, float y, string excludedColorCode, byte tolerance = 0) => DoesNotHaveColorAt(screenshot, x, y, ColorCodeParser.Parse(excludedColorCode), tolerance);
public static void HasColorAt(FileInfo screenshot, float x, float y, string expectedColorCode, byte tolerance = 0) => HasColorAt(screenshot, x, y, ColorCodeParser.Parse(expectedColorCode), tolerance);