1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +01:00
MLEM/Tests/CameraTests.cs

20 lines
541 B
C#
Raw Normal View History

2020-07-31 17:14:25 +02:00
using System.Numerics;
using MLEM.Cameras;
using NUnit.Framework;
using Tests.Stub;
using Vector2 = Microsoft.Xna.Framework.Vector2;
namespace Tests {
public class CameraTests {
[Test]
public void TestConversions([Range(-4, 4, 4F)] float x, [Range(-4, 4, 4F)] float y) {
var camera = new Camera(new StubGraphics());
var pos = new Vector2(x, y);
var cam = camera.ToCameraPos(pos);
var ret = camera.ToWorldPos(cam);
Assert.AreEqual(pos, ret);
}
}
}