2023-08-26 18:15:04 +01:00
|
|
|
using System;
|
2022-05-28 14:19:46 +01:00
|
|
|
using System.Drawing;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using X10D.Unity.Drawing;
|
|
|
|
|
|
|
|
namespace X10D.Unity.Tests.Drawing
|
|
|
|
{
|
|
|
|
public class SizeTests
|
|
|
|
{
|
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 Size(random.Next(), random.Next());
|
|
|
|
var vector = size.ToUnityVector2();
|
|
|
|
|
2023-04-05 22:51:04 +01:00
|
|
|
Assert.That(vector.x, Is.EqualTo(size.Width));
|
|
|
|
Assert.That(vector.y, Is.EqualTo(size.Height));
|
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 size = new Size(random.Next(), random.Next());
|
|
|
|
var vector = size.ToUnityVector2Int();
|
|
|
|
|
2023-04-05 22:51:04 +01:00
|
|
|
Assert.That(vector.x, Is.EqualTo(size.Width));
|
|
|
|
Assert.That(vector.y, Is.EqualTo(size.Height));
|
2022-05-28 14:19:46 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|