RectTests.cs 1003 B

1234567891011121314151617181920212223242526272829303132
  1. using PixiEditor.Helpers.Extensions;
  2. using SkiaSharp;
  3. using System.Windows;
  4. using Xunit;
  5. namespace PixiEditorTests.ModelsTests.PositionTests
  6. {
  7. public class RectTests
  8. {
  9. [Fact]
  10. public void TestThatInt32RectToSKRectIWorks()
  11. {
  12. Int32Rect rect = new Int32Rect(5, 2, 8, 10);
  13. SKRectI converted = rect.ToSKRectI();
  14. Assert.Equal(rect.X, converted.Left);
  15. Assert.Equal(rect.Y, converted.Top);
  16. Assert.Equal(rect.Width, converted.Width);
  17. Assert.Equal(rect.Height, converted.Height);
  18. }
  19. [Fact]
  20. public void TestThatSKRectIToInt32RectWorks()
  21. {
  22. SKRectI rect = new SKRectI(5, 2, 8, 10);
  23. Int32Rect converted = rect.ToInt32Rect();
  24. Assert.Equal(rect.Left, converted.X);
  25. Assert.Equal(rect.Top, converted.Y);
  26. Assert.Equal(rect.Width, converted.Width);
  27. Assert.Equal(rect.Height, converted.Height);
  28. }
  29. }
  30. }