using NUnit.Framework;
using SatorImaging.AppWindowUtility;
using UnityEngine;

public class ResizeTest {
	[Test]
	public void CheckCenter() {
		Vector2 mousePos = new(500, 500);
		Vector2 screenSize = new(1280, 1920);

		Assert.AreEqual(new Vector2(0, 0), ResizeHelper.GetDirection(mousePos, screenSize));
	}

	[Test]
	public void CheckTopLeft() {
		Vector2 mousePos = new(0, 0);
		Vector2 screenSize = new(1280, 1920);

		Assert.AreEqual(new Vector2(-1, 1), ResizeHelper.GetDirection(mousePos, screenSize));
	}

	[Test]
	public void CheckTop() {
		Vector2 mousePos = new(500, 0);
		Vector2 screenSize = new(1280, 1920);

		Assert.AreEqual(new Vector2(0, 1), ResizeHelper.GetDirection(mousePos, screenSize));
	}

	[Test]
	public void CheckTopRight() {
		Vector2 mousePos = new(1280, 0);
		Vector2 screenSize = new(1280, 1920);

		Assert.AreEqual(new Vector2(1, 1), ResizeHelper.GetDirection(mousePos, screenSize));
	}

	[Test]
	public void CheckLeft() {
		Vector2 mousePos = new(0, 500);
		Vector2 screenSize = new(1280, 1920);

		Assert.AreEqual(new Vector2(-1, 0), ResizeHelper.GetDirection(mousePos, screenSize));
	}

	[Test]
	public void CheckRight() {
		Vector2 mousePos = new(1280, 500);
		Vector2 screenSize = new(1280, 1920);

		Assert.AreEqual(new Vector2(1, 0), ResizeHelper.GetDirection(mousePos, screenSize));
	}

	[Test]
	public void CheckBottomLeft() {
		Vector2 mousePos = new(0, 1920);
		Vector2 screenSize = new(1280, 1920);

		Assert.AreEqual(new Vector2(-1, -1), ResizeHelper.GetDirection(mousePos, screenSize));
	}

	[Test]
	public void CheckBottom() {
		Vector2 mousePos = new(500, 1920);
		Vector2 screenSize = new(1280, 1920);

		Assert.AreEqual(new Vector2(0, -1), ResizeHelper.GetDirection(mousePos, screenSize));
	}

	[Test]
	public void CheckBottomRight() {
		Vector2 mousePos = new(1280, 1920);
		Vector2 screenSize = new(1280, 1920);

		Assert.AreEqual(new Vector2(1, -1), ResizeHelper.GetDirection(mousePos, screenSize));
	}
}