mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 07:35:42 +00:00
23 lines
606 B
C#
23 lines
606 B
C#
using System;
|
|
using System.Drawing;
|
|
using NUnit.Framework;
|
|
using X10D.Core;
|
|
using X10D.Unity.Drawing;
|
|
|
|
namespace X10D.Unity.Tests.Drawing
|
|
{
|
|
public class PointFTests
|
|
{
|
|
[Test]
|
|
public void ToUnityVector2_ShouldReturnVector_WithEquivalentMembers()
|
|
{
|
|
var random = new Random();
|
|
var point = new PointF(random.NextSingle(), random.NextSingle());
|
|
var vector = point.ToUnityVector2();
|
|
|
|
Assert.That(vector.x, Is.EqualTo(point.X).Within(1e-6f));
|
|
Assert.That(vector.y, Is.EqualTo(point.Y).Within(1e-6f));
|
|
}
|
|
}
|
|
}
|