Kni.Extended (#892)

* KNI projects

* update actions

fixes MSBUILD : error MSB1011: Specify which project or solution file to
use because this folder contains more than one project or solution file.

* remove test for issue #633

* build tests

* KNI TypeReaders

* KNI/XNA compatible code

* GetRuntimeReader from runtime types

* remove MockGameWindow
This commit is contained in:
Nikos Kastellanos
2024-06-23 22:38:20 -04:00
committed by GitHub
parent 8850875fb4
commit 2bbdc38b51
35 changed files with 657 additions and 84 deletions
@@ -22,28 +22,5 @@ namespace MonoGame.Extended.Tests.Content
Assert.True(ContentReaderExtensions.ShortenRelativePath(input) == expectedoutput);
}
// Test added for issue #633
// https://github.com/craftworkgames/MonoGame.Extended/issues/633
//
// Issue states that the input string from a json file is parsed in correctly by the content reader.
// Adding this test to ensure that GetRelativeAssetName is parsed correctly.
[Theory]
[InlineData("test.tex.png", "test.tex")]
public void ContentReaderExtensions_GetRelativeAssetName(string input, string expected)
{
var contentReaderType = typeof(Microsoft.Xna.Framework.Content.ContentReader).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic).First();
var contentReader = (Microsoft.Xna.Framework.Content.ContentReader)contentReaderType.Invoke(new object[]
{
null, // manager: parameter
new MemoryStream(), // stream: parameter
$"{expected}.xnb", // assetName: parameter
0, // version: parameter
null // recordDisposableObject: parameter
});
var actual = contentReader.GetRelativeAssetName(input);
Assert.Equal(expected, actual);
}
}
}