2022-05-28 14:19:46 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using X10D.Core;
|
|
|
|
|
using X10D.Unity.Drawing;
|
|
|
|
|
|
|
|
|
|
namespace X10D.Unity.Tests.Drawing
|
|
|
|
|
{
|
|
|
|
|
public class PointFTests
|
|
|
|
|
{
|
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 PointF(random.NextSingle(), random.NextSingle());
|
|
|
|
|
var vector = point.ToUnityVector2();
|
|
|
|
|
|
2023-04-05 22:51:04 +01:00
|
|
|
|
Assert.That(vector.x, Is.EqualTo(point.X).Within(1e-6f));
|
|
|
|
|
Assert.That(vector.y, Is.EqualTo(point.Y).Within(1e-6f));
|
2022-05-28 14:19:46 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|