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 SizeFTests
|
|
|
|
|
{
|
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 size = new SizeF(random.NextSingle(), random.NextSingle());
|
|
|
|
|
var vector = size.ToUnityVector2();
|
|
|
|
|
|
2023-04-05 22:51:04 +01:00
|
|
|
|
Assert.That(vector.x, Is.EqualTo(size.Width).Within(1e-6f));
|
|
|
|
|
Assert.That(vector.y, Is.EqualTo(size.Height).Within(1e-6f));
|
2022-05-28 14:19:46 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|