mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
20 lines
No EOL
541 B
C#
20 lines
No EOL
541 B
C#
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);
|
|
}
|
|
|
|
}
|
|
} |