DotTiled/DotTiled.Tests/Serialization/Tmj/TmjMapReaderTests.cs

66 lines
1.3 KiB
C#
Raw Normal View History

2024-08-06 22:39:50 +02:00
namespace DotTiled.Tests;
public partial class TmjMapReaderTests
{
[Fact]
public void Test1()
{
// Arrange
var jsonString =
"""
{
"backgroundcolor":"#656667",
"height":4,
"nextobjectid":1,
"nextlayerid":1,
"orientation":"orthogonal",
"properties": [
{
"name":"mapProperty1",
"type":"string",
"value":"one"
},
{
"name":"mapProperty3",
"type":"string",
"value":"twoeee"
}
],
2024-08-06 22:39:50 +02:00
"renderorder":"right-down",
"tileheight":32,
"tilewidth":32,
"version":"1",
"tiledversion":"1.0.3",
"width":4,
"tilesets": [
{
"columns":19,
"firstgid":1,
"image":"image/fishbaddie_parts.png",
"imageheight":480,
"imagewidth":640,
"margin":3,
"name":"",
"properties":[
{
"name":"myProperty1",
"type":"string",
"value":"myProperty1_value"
}],
"spacing":1,
"tilecount":266,
"tileheight":32,
"tilewidth":32
}
]
2024-08-06 22:39:50 +02:00
}
""";
// Act
using var tmjMapReader = new TmjMapReader(jsonString);
// Assert
var map = tmjMapReader.ReadMap();
}
}