mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 04:53:29 +01:00
18 lines
468 B
C#
18 lines
468 B
C#
using Microsoft.Xna.Framework;
|
|
using MLEM.Cameras;
|
|
using NUnit.Framework;
|
|
|
|
namespace Tests;
|
|
|
|
public class CameraTests : GameTestFixture {
|
|
|
|
[Test]
|
|
public void TestConversions([Range(-4, 4, 4F)] float x, [Range(-4, 4, 4F)] float y) {
|
|
var camera = new Camera(this.Game.GraphicsDevice);
|
|
var pos = new Vector2(x, y);
|
|
var cam = camera.ToCameraPos(pos);
|
|
var ret = camera.ToWorldPos(cam);
|
|
Assert.AreEqual(pos, ret);
|
|
}
|
|
|
|
}
|