RectangleToolTests.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics.CodeAnalysis;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Windows;
  7. using PixiEditor;
  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 RectangleToolTests
  15. {
  16. [StaTheory]
  17. [InlineData(0,0, 2,2)]
  18. [InlineData(0,0, 9, 9)]
  19. [InlineData(5,5, 6, 6)]
  20. [InlineData(0,0, 15, 15)]
  21. public void TestThatCreateRectangleCalculatesCorrectOutlineWithOneThickness(int startX, int startY, int endX, int endY)
  22. {
  23. RectangleTool tool = new RectangleTool();
  24. var outline = tool.CreateRectangle(new Coordinates(startX, startY),
  25. new Coordinates(endX, endY), 1);
  26. int expectedBorderPoints = (endX - startX) * 2 + (endY - startX) * 2;
  27. Assert.Equal(expectedBorderPoints, outline.Count());
  28. }
  29. }
  30. }