soundvision/UnityProject/Assets/Editor/UnitTest/UnitTest_RectangularSelection.cs
2019-10-01 23:01:56 +02:00

21 lines
No EOL
667 B
C#

using NUnit.Framework;
using UnityEngine;
namespace cylvester
{
[TestFixture]
public class UnitTest_RectangularSelection
{
[Test]
public void Update()
{
var paintSpace = new Rect(0, 0, 100, 100); // GUI
var rectangularSelection = new RectangularSelection(1000, 1000); // texture 10 times larger
rectangularSelection.Start(new Vector2(10, 10));
var selectionInTexture = rectangularSelection.Update(new Vector2(20, 20), ref paintSpace);
var expected = new Rect(100, 100, 100, 100);
Assert.AreEqual(expected, selectionInTexture);
}
}
}