BitmapOperationsUtilityTests.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using PixiEditor.Models.Controllers;
  2. using PixiEditor.Models.DataHolders;
  3. using PixiEditor.Models.Layers;
  4. using PixiEditor.Models.Position;
  5. using SkiaSharp;
  6. using System.Collections.Generic;
  7. using Xunit;
  8. namespace PixiEditorTests.ModelsTests.ControllersTests
  9. {
  10. public class BitmapOperationsUtilityTests
  11. {
  12. //[Fact]
  13. //public void TestThatBitmapOperationsUtilityDeletesPixels()
  14. //{
  15. // BitmapOperationsUtility util = new BitmapOperationsUtility(new BitmapManager());
  16. // util.Manager.ActiveDocument = new Document(10, 10);
  17. // Layer testLayer = new Layer("test layer", 10, 10);
  18. // Coordinates[] cords = { new Coordinates(0, 0), new Coordinates(1, 1) };
  19. // BitmapPixelChanges pixels = BitmapPixelChanges.FromSingleColoredArray(cords, SKColors.Black);
  20. // testLayer.SetPixels(pixels);
  21. // util.DeletePixels(new[] { testLayer }, cords);
  22. // Assert.Equal(0, testLayer.GetPixel(0, 0).Alpha);
  23. // Assert.Equal(0, testLayer.GetPixel(1, 1).Alpha);
  24. //}
  25. //[StaFact]
  26. //public void TestThatBitmapOperationsUtilityExecutesPenToolProperly()
  27. //{
  28. // BitmapManager manager = new BitmapManager
  29. // {
  30. // ActiveDocument = new Document(10, 10),
  31. // PrimaryColor = SKColors.Black
  32. // };
  33. // manager.ActiveDocument.AddNewLayer("Test layer", 10, 10);
  34. // BitmapOperationsUtility util = new BitmapOperationsUtility(manager);
  35. // List<Coordinates> mouseMove = new List<Coordinates>(new[] { new Coordinates(0, 0) });
  36. // util.ExecuteTool(new Coordinates(0, 0), mouseMove, new MockedSinglePixelPenTool());
  37. // Assert.Equal(manager.ActiveLayer.GetPixel(0, 0), SKColors.Black);
  38. //}
  39. }
  40. }