2022-05-28 14:19:46 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using X10D.Unity.Drawing;
|
|
|
|
|
|
|
|
|
|
namespace X10D.Unity.Tests.Drawing
|
|
|
|
|
{
|
|
|
|
|
public class PointTests
|
|
|
|
|
{
|
2023-04-05 19:18:06 +01:00
|
|
|
|
[Test]
|
|
|
|
|
public void ToUnityVector2_ShouldReturnVector_WithEquivalentMembers()
|
2022-05-28 14:19:46 +01:00
|
|
|
|
{
|
|
|
|
|
var random = new Random();
|
|
|
|
|
var point = new Point(random.Next(), random.Next());
|
|
|
|
|
var vector = point.ToUnityVector2();
|
|
|
|
|
|
2023-04-05 22:51:04 +01:00
|
|
|
|
Assert.That(vector.x, Is.EqualTo(point.X));
|
|
|
|
|
Assert.That(vector.y, Is.EqualTo(point.Y));
|
2022-05-28 14:19:46 +01:00
|
|
|
|
}
|
|
|
|
|
|
2023-04-05 19:18:06 +01:00
|
|
|
|
[Test]
|
|
|
|
|
public void ToUnityVector2Int_ShouldReturnVector_WithEquivalentMembers()
|
2022-05-28 14:19:46 +01:00
|
|
|
|
{
|
|
|
|
|
var random = new Random();
|
|
|
|
|
var point = new Point(random.Next(), random.Next());
|
|
|
|
|
var vector = point.ToUnityVector2Int();
|
|
|
|
|
|
2023-04-05 22:51:04 +01:00
|
|
|
|
Assert.That(vector.x, Is.EqualTo(point.X));
|
|
|
|
|
Assert.That(vector.y, Is.EqualTo(point.Y));
|
2022-05-28 14:19:46 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|