mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-14 05:15:41 +00:00
23 lines
603 B
C#
23 lines
603 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));
|
|
}
|
|
}
|
|
}
|