CoordinatesCalculatorTests.cs 673 B

1234567891011121314151617181920
  1. using NUnit.Framework;
  2. using PixiEditor.Models.Position;
  3. namespace PixiEditorTests.ModelsTests.PositionTests
  4. {
  5. [TestFixture]
  6. public class CoordinatesCalculatorTests
  7. {
  8. [TestCase(0, 0, 3, 3, 1, 1)]
  9. [TestCase(0, 0, 2, 2, 1, 1)]
  10. [TestCase(5, 5, 7, 7, 6, 6)]
  11. [TestCase(5, 5, 9, 9, 7, 7)]
  12. public void TestGetCenter(int x1, int y1, int x2, int y2, int expectedX, int expectedY)
  13. {
  14. Coordinates center = CoordinatesCalculator.GetCenterPoint(new Coordinates(x1, y1), new Coordinates(x2, y2));
  15. Assert.AreEqual(new Coordinates(expectedX, expectedY), center);
  16. }
  17. }
  18. }