-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve some test methods #14753
Improve some test methods #14753
Conversation
throw new XunitException($"Color {expectedColor} not found."); | ||
throw new XunitException(CreateColorError(bitmap, $"Color {expectedColor} not found.")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the bitmap contents to the output.
var window = view.GetParentOfType<Window>() ?? throw new InvalidOperationException("View was attached to a window but there was no window."); | ||
// Window is not a XAML type so is never on the hierarchy | ||
var window = view.GetParentOfType<TestWindowRoot>()?.Window ?? throw new InvalidOperationException("View was attached to a window but there was no window."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would never work as Window is not a Xaml object.
public static Task<CanvasBitmap> AssertDoesNotContainColor(this CanvasBitmap bitmap, Graphics.Color unexpectedColor, Func<Graphics.RectF, Graphics.RectF>? withinRectModifier = null) | ||
=> bitmap.AssertDoesNotContainColor(unexpectedColor.ToWindowsColor(), withinRectModifier); | ||
|
||
public static async Task<CanvasBitmap> AssertDoesNotContainColor(this CanvasBitmap bitmap, WColor unexpectedColor, Func<Graphics.RectF, Graphics.RectF>? withinRectModifier = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this missing assert.
throw new XunitException($"Color {expectedColor} not found."); | ||
throw new XunitException(CreateColorError(bitmap, $"Color {expectedColor} not found.")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the bitmap contents to the output.
Description of Change
Just improving some test methods.