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

39 lines
1.0 KiB
C#
Raw Normal View History

using System;
using System.Collections;
using System.Drawing;
using NUnit.Framework;
using UnityEngine.TestTools;
using X10D.Unity.Drawing;
namespace X10D.Unity.Tests.Drawing
{
public class SizeTests
{
[UnityTest]
public IEnumerator ToUnityVector2_ShouldReturnVector_WithEquivalentMembers()
{
var random = new Random();
var size = new Size(random.Next(), random.Next());
var vector = size.ToUnityVector2();
Assert.AreEqual(size.Width, vector.x);
Assert.AreEqual(size.Height, vector.y);
yield break;
}
[UnityTest]
public IEnumerator ToUnityVector2Int_ShouldReturnVector_WithEquivalentMembers()
{
var random = new Random();
var size = new Size(random.Next(), random.Next());
var vector = size.ToUnityVector2Int();
Assert.AreEqual(size.Width, vector.x);
Assert.AreEqual(size.Height, vector.y);
yield break;
}
}
}