1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-05-05 17:37:06 +02:00
MLEM/Tests/DataTextureAtlasTests.cs
2021-03-18 17:28:08 +01:00

25 lines
715 B
C#

using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MLEM.Data;
using MLEM.Data.Content;
using NUnit.Framework;
using Tests.Stub;
namespace Tests {
public class TestDataTextureAtlas {
[Test]
public void Test() {
var atlas = DataTextureAtlas.LoadAtlasData(null, new RawContentManager(new StubServices()), "Texture.atlas");
Assert.AreEqual(atlas.Regions.Count(), 5);
var table = atlas["LongTableUp"];
Assert.AreEqual(table.Area, new Rectangle(0, 32, 64, 48));
Assert.AreEqual(table.PivotPixels, new Vector2(16, 48 - 32));
}
}
}