ImageGeneratorTests.cs 855 B

12345678910111213141516171819202122232425
  1. using NUnit.Framework;
  2. using PixiEditor.Models.Images;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. using System.Windows.Controls;
  7. using System.Windows.Media;
  8. namespace PixiEditorTests.ToolsTests
  9. {
  10. [TestFixture, Apartment(System.Threading.ApartmentState.STA)]
  11. public class ImageGeneratorTests
  12. {
  13. [TestCase(16,16)]
  14. [TestCase(1024,12)]
  15. [TestCase(50000,50000)]
  16. public void ImageIsPixelArtReady(int width, int height)
  17. {
  18. Image img = ImageGenerator.GenerateForPixelArts(width, height);
  19. Assert.IsTrue(img.Stretch == Stretch.Uniform && RenderOptions.GetBitmapScalingMode(img) == BitmapScalingMode.NearestNeighbor
  20. && RenderOptions.GetEdgeMode(img) == EdgeMode.Aliased && img.Width == width && img.Height == height);
  21. }
  22. }
  23. }