LineToolTests.cs 941 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using PixiEditor.Models.DataHolders;
  6. using PixiEditor.Models.Enums;
  7. using PixiEditor.Models.Layers;
  8. using PixiEditor.Models.Position;
  9. using PixiEditor.Models.Tools.Tools;
  10. using Xunit;
  11. namespace PixiEditorTests.ModelsTests.ToolsTests
  12. {
  13. [Collection("Application collection")]
  14. public class LineToolTests
  15. {
  16. [StaTheory]
  17. [InlineData(2)]
  18. [InlineData(10)]
  19. [InlineData(100)]
  20. public void TestThatCreateLineCreatesDiagonalLine(int length)
  21. {
  22. LineTool lineTool = new LineTool();
  23. var line = lineTool.CreateLine(new Coordinates(0,0), new Coordinates(length - 1, length - 1), 1);
  24. Assert.Equal(length, line.Count());
  25. for (int i = 0; i < length; i++)
  26. {
  27. Assert.Contains(new Coordinates(i,i), line);
  28. }
  29. }
  30. }
  31. }