PenToolTests.cs 922 B

123456789101112131415161718192021222324252627
  1. using PixiEditor.Models.Position;
  2. using PixiEditor.Models.Tools.Tools;
  3. using Xunit;
  4. namespace PixiEditorTests.ModelsTests.ToolsTests
  5. {
  6. [Collection("Application collection")]
  7. public class PenToolTests
  8. {
  9. [StaFact]
  10. public void TestThatPixelPerfectPenReturnsShapeWithoutLShapePixels()
  11. {
  12. PenTool pen = new PenTool();
  13. Coordinates start = new Coordinates(0, 0);
  14. Coordinates end = new Coordinates(0, 0);
  15. Coordinates end2 = new Coordinates(1, 0);
  16. Coordinates start2 = new Coordinates(1, 1);
  17. pen.Draw(start, end, System.Windows.Media.Colors.Black, 1, true);
  18. pen.Draw(end, end2, System.Windows.Media.Colors.Black, 1, true);
  19. var points = pen.Draw(end2, start2, System.Windows.Media.Colors.Black, 1, true);
  20. Assert.Contains(points.ChangedPixels, x => x.Value.A == 0);
  21. }
  22. }
  23. }