Skip to content

Commit

Permalink
this
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed May 5, 2023
1 parent 04113fb commit bba2872
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/TestUtils/src/DeviceTests/AssertionExtensions.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -597,13 +597,13 @@ public static Task AssertNotEqualAsync(this Bitmap bitmap, Bitmap other)
return Task.CompletedTask;
}

public static async Task ThrowScreenshot(this AView view, IMauiContext mauiContext, Exception? ex = null)
public static async Task ThrowScreenshot(this AView view, IMauiContext mauiContext, string? message = null, Exception? ex = null)
{
var bitmap = await view.ToBitmap(mauiContext);
if (ex is null)
throw new XunitException(CreateScreenshotError(bitmap, "There was an error."));
throw new XunitException(CreateScreenshotError(bitmap, message ?? "There was an error."));
else
throw new XunitException(CreateScreenshotError(bitmap, "There was an error: " + ex.Message), ex);
throw new XunitException(CreateScreenshotError(bitmap, message ?? "There was an error: " + ex.Message), ex);
}

public static TextUtils.TruncateAt? ToPlatform(this LineBreakMode mode) =>
Expand Down
6 changes: 3 additions & 3 deletions src/TestUtils/src/DeviceTests/AssertionExtensions.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,13 @@ bool IsMatching()
}
}

public static async Task ThrowScreenshot(this FrameworkElement view, IMauiContext mauiContext, Exception? ex = null)
public static async Task ThrowScreenshot(this FrameworkElement view, IMauiContext mauiContext, string? message = null, Exception? ex = null)
{
var bitmap = await view.ToBitmap(mauiContext);
if (ex is null)
throw new XunitException(await CreateScreenshotError(bitmap, "There was an error."));
throw new XunitException(await CreateScreenshotError(bitmap, message ?? "There was an error."));
else
throw new XunitException(await CreateScreenshotError(bitmap, "There was an error: " + ex.Message), ex);
throw new XunitException(await CreateScreenshotError(bitmap, message ?? "There was an error: " + ex.Message), ex);
}

public static TextTrimming ToPlatform(this LineBreakMode mode) =>
Expand Down
6 changes: 3 additions & 3 deletions src/TestUtils/src/DeviceTests/AssertionExtensions.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,13 @@ bool IsMatching()
}
}

public static async Task ThrowScreenshot(this UIView view, IMauiContext mauiContext, Exception? ex = null)
public static async Task ThrowScreenshot(this UIView view, IMauiContext mauiContext, string? message = null, Exception? ex = null)
{
var bitmap = await view.ToBitmap(mauiContext);
if (ex is null)
throw new XunitException(CreateScreenshotError(bitmap, "There was an error."));
throw new XunitException(CreateScreenshotError(bitmap, message ?? "There was an error."));
else
throw new XunitException(CreateScreenshotError(bitmap, "There was an error: " + ex.Message), ex);
throw new XunitException(CreateScreenshotError(bitmap, message ?? "There was an error: " + ex.Message), ex);
}

public static UILineBreakMode ToPlatform(this LineBreakMode mode) =>
Expand Down

0 comments on commit bba2872

Please sign in to comment.