mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-21 01:39:32 +00:00
23 lines
1.1 KiB
C#
23 lines
1.1 KiB
C#
using System;
|
|
using System.Linq;
|
|
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);
|
|
}
|
|
}
|
|
} |