1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-14 22:55:40 +00:00
X10D/X10D.Unity.Tests/Assets/Tests/Drawing/RectIntTests.cs

37 lines
1.3 KiB
C#
Raw Normal View History

using NUnit.Framework;
2022-06-01 11:06:24 +01:00
using UnityEngine;
using X10D.Unity.Drawing;
using Random = System.Random;
namespace X10D.Unity.Tests.Drawing
{
public class RectIntTests
{
[Test]
public void ToSystemRectangle_ShouldReturnRectangleF_WithEquivalentMembers()
2022-06-01 11:06:24 +01:00
{
var random = new Random();
var rect = new RectInt(random.Next(), random.Next(), random.Next(), random.Next());
var rectangle = rect.ToSystemRectangle();
Assert.That(rectangle.X, Is.EqualTo(rect.x));
Assert.That(rectangle.Y, Is.EqualTo(rect.y));
Assert.That(rectangle.Width, Is.EqualTo(rect.width));
Assert.That(rectangle.Height, Is.EqualTo(rect.height));
2022-06-01 11:06:24 +01:00
}
[Test]
public void ToSystemRectangleF_ShouldReturnRectangleF_WithEquivalentMembers()
2022-06-01 11:06:24 +01:00
{
var random = new Random();
var rect = new RectInt(random.Next(), random.Next(), random.Next(), random.Next());
var rectangle = rect.ToSystemRectangleF();
Assert.That(rectangle.X, Is.EqualTo(rect.x));
Assert.That(rectangle.Y, Is.EqualTo(rect.y));
Assert.That(rectangle.Width, Is.EqualTo(rect.width));
Assert.That(rectangle.Height, Is.EqualTo(rect.height));
2022-06-01 11:06:24 +01:00
}
}
}