1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-13 01:55:42 +00:00
X10D/X10D.Unity.Tests/Assets/Tests/Drawing/RectangleTests.cs

37 lines
1.3 KiB
C#

using System.Drawing;
using NUnit.Framework;
using X10D.Unity.Drawing;
using Random = System.Random;
namespace X10D.Unity.Tests.Drawing
{
public class RectangleTests
{
[Test]
public void ToUnityRect_ShouldReturnRect_WithEquivalentMembers()
{
var random = new Random();
var rectangle = new Rectangle(random.Next(), random.Next(), random.Next(), random.Next());
var rect = rectangle.ToUnityRect();
Assert.That(rect.x, Is.EqualTo(rectangle.X));
Assert.That(rect.y, Is.EqualTo(rectangle.Y));
Assert.That(rect.width, Is.EqualTo(rectangle.Width));
Assert.That(rect.height, Is.EqualTo(rectangle.Height));
}
[Test]
public void ToUnityRectInt_ShouldReturnRect_WithEquivalentMembers()
{
var random = new Random();
var rectangle = new Rectangle(random.Next(), random.Next(), random.Next(), random.Next());
var rect = rectangle.ToUnityRectInt();
Assert.That(rect.x, Is.EqualTo(rectangle.X));
Assert.That(rect.y, Is.EqualTo(rectangle.Y));
Assert.That(rect.width, Is.EqualTo(rectangle.Width));
Assert.That(rect.height, Is.EqualTo(rectangle.Height));
}
}
}