Modelling soon done, starting tests structuring

This commit is contained in:
Daniel Cronqvist 2024-07-26 00:37:47 +02:00
parent d2be83972d
commit 70fc74f43b
46 changed files with 1883 additions and 1230 deletions

View file

@ -0,0 +1,18 @@
using System.Xml;
namespace DotTiled.Tests;
public static class TmxSerializerTestData
{
public static XmlReader GetReaderFor(string testDataFile)
{
var fullyQualifiedTestDataFile = $"DotTiled.Tests.{testDataFile}";
using var stream = typeof(TmxSerializerTestData).Assembly.GetManifestResourceStream(fullyQualifiedTestDataFile)
?? throw new ArgumentException($"Test data file '{fullyQualifiedTestDataFile}' not found");
using var stringReader = new StreamReader(stream);
var xml = stringReader.ReadToEnd();
var xmlStringReader = new StringReader(xml);
return XmlReader.Create(xmlStringReader);
}
}