RectangleToolTests.cs 1008 B

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics.CodeAnalysis;
  4. using System.Text;
  5. using System.Windows;
  6. using PixiEditor;
  7. using PixiEditor.Models.Position;
  8. using PixiEditor.Models.Tools.Tools;
  9. using Xunit;
  10. namespace PixiEditorTests.ModelsTests.ToolsTests
  11. {
  12. [Collection("Application collection")]
  13. public class RectangleToolTests
  14. {
  15. [StaTheory]
  16. [InlineData(0,0, 2,2)]
  17. [InlineData(0,0, 9, 9)]
  18. [InlineData(5,5, 6, 6)]
  19. [InlineData(0,0, 15, 15)]
  20. public void TestThatCreateRectangleCalculatesCorrectOutlineWithOneThickness(int startX, int startY, int endX, int endY)
  21. {
  22. RectangleTool tool = new RectangleTool();
  23. var outline = tool.CreateRectangle(new Coordinates(startX, startY),
  24. new Coordinates(endX, endY), 1);
  25. int expectedBorderPoints = (endX - startX) * 2 + (endY - startX) * 2;
  26. Assert.Equal(expectedBorderPoints, outline.Length);
  27. }
  28. }
  29. }