XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
UTF-8
using XFEEliteDangerous.Client;
using Xunit;

namespace XFEEliteDangerous.Client.Tests;

public sealed class LocalPathsTests
{
    [Theory]
    [InlineData(@"\\server\share\save")]
    [InlineData("//server/share/save")]
    [InlineData(@"\\?\C:\save")]
    [InlineData(@"\\.\pipe\save")]
    [InlineData("")]
    public void NetworkAndDevicePathsAreRejectedWithoutOpeningThem(string path) => Assert.Throws<ArgumentException>(() => LocalPaths.Directory(path));
    [Fact] public void LocalDirectoryIsNormalized() => Assert.Equal(Path.GetFullPath(Path.GetTempPath()).TrimEnd(Path.DirectorySeparatorChar), LocalPaths.Directory(Path.Combine(Path.GetTempPath(), ".")).TrimEnd(Path.DirectorySeparatorChar));
}