Browse Source

Fix xUnit warnings

pull/20967/head
Julien Lebosquain 18 hours ago
parent
commit
c1759f938a
No known key found for this signature in database GPG Key ID: 1833CAD10ACC46FD
  1. 4
      tests/Avalonia.Base.UnitTests/Layout/LayoutableTests_LayoutRounding.cs
  2. 12
      tests/Avalonia.IntegrationTests.Appium/WindowTests.cs

4
tests/Avalonia.Base.UnitTests/Layout/LayoutableTests_LayoutRounding.cs

@ -112,7 +112,7 @@ namespace Avalonia.Base.UnitTests.Layout
{
if (!expected.NearlyEquals(actual))
{
throw EqualException.ForMismatchedValues(expected, actual);
throw EqualException.ForMismatchedValues(expected.ToString(), actual.ToString());
}
}
@ -120,7 +120,7 @@ namespace Avalonia.Base.UnitTests.Layout
{
if (!expected.NearlyEquals(actual))
{
throw EqualException.ForMismatchedValues(expected, actual);
throw EqualException.ForMismatchedValues(expected.ToString(), actual.ToString());
}
}

12
tests/Avalonia.IntegrationTests.Appium/WindowTests.cs

@ -459,17 +459,13 @@ namespace Avalonia.IntegrationTests.Appium
// WindowStartupLocation needs to be calculated before the window is shown, meaning that
// the position of a centered window can be off by a bit. From initial testing, looks
// like this shouldn't be more than 10 pixels.
if (Math.Abs(expected.X - actual.X) > 10)
throw EqualException.ForMismatchedValues(expected, actual);
if (Math.Abs(expected.Y - actual.Y) > 10)
throw EqualException.ForMismatchedValues(expected, actual);
Assert.Equal(expected.X, actual.X, 10.0);
Assert.Equal(expected.Y, actual.Y, 10.0);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
if (Math.Abs(expected.X - actual.X) > 15)
throw EqualException.ForMismatchedValues(expected, actual);
if (Math.Abs(expected.Y - actual.Y) > 15)
throw EqualException.ForMismatchedValues(expected, actual);
Assert.Equal(expected.X, actual.X, 15.0);
Assert.Equal(expected.Y, actual.Y, 15.0);
}
else
{

Loading…
Cancel
Save