forked from ReClassNET/ReClass.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPathUtilTest.cs
27 lines (25 loc) · 842 Bytes
/
PathUtilTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.Collections.Generic;
using System.IO;
using NFluent;
using ReClassNET.Util;
using Xunit;
namespace ReClass.NET_Tests.Util
{
public class PathUtilTest
{
public static IEnumerable<object[]> GetTestConversionData() => new List<object[]>
{
new object[] { string.Empty, string.Empty },
new object[] { "C:/", "C:" + Path.DirectorySeparatorChar },
new object[] { @"C:\", "C:" + Path.DirectorySeparatorChar },
new object[] { "C:/test.test", Path.Combine("C:" + Path.DirectorySeparatorChar, "test.test") },
new object[] { "file:///C:/test.test", Path.Combine("C:" + Path.DirectorySeparatorChar, "test.test") },
};
[Theory]
[MemberData(nameof(GetTestConversionData))]
public void TestConversion(string input, string expected)
{
Check.That(PathUtil.FileUrlToPath(input)).IsEqualTo(expected);
}
}
}