mirror of
https://github.com/dcronqvist/DotTiled.git
synced 2025-07-07 14:17:51 +03:00
Modelling soon done, starting tests structuring
This commit is contained in:
parent
d2be83972d
commit
70fc74f43b
46 changed files with 1883 additions and 1230 deletions
18
DotTiled.Tests/TmxSerializer/TestData/TestData.cs
Normal file
18
DotTiled.Tests/TmxSerializer/TestData/TestData.cs
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue