Files
Nikos Kastellanos 2bbdc38b51 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
2024-06-23 22:38:20 -04:00

27 lines
1.1 KiB
C#

using System;
using System.IO;
using System.Linq;
using System.Reflection;
using MonoGame.Extended.Collections;
using MonoGame.Extended.Content;
using Xunit;
namespace MonoGame.Extended.Tests.Content
{
public class ContentReaderExtensionsTests
{
[Theory]
[InlineData("testsuperdir/testsubdir1/testsubdir2/resource", "testsuperdir/testsubdir1/testsubdir2/resource")]
[InlineData("testsuperdir/testsubdir1/../testsubdir2/resource", "testsuperdir/testsubdir2/resource")]
[InlineData("testsuperdir/../resource", "resource")]
[InlineData("../testsuperdir/testsubdir1/../testsubdir2/resource", "../testsuperdir/testsubdir2/resource")]
[InlineData("testsuperdir/testsubdir1/testsubdir2/../../testsubdir3/resource", "testsuperdir/testsubdir3/resource")]
[InlineData("testsuperdir/testsubdir1/../testsubdir2/../testsubdir3/resource", "testsuperdir/testsubdir3/resource")]
public void ContentReaderExtensions_ShortenRelativePath(string input, string expectedoutput)
{
Assert.True(ContentReaderExtensions.ShortenRelativePath(input) == expectedoutput);
}
}
}