解决 args 变量没有赋值导致的参数传递失败的问题。by Soar360
大石头 编写于 2023-09-09 07:16:48
X
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Xunit;

namespace XUnitTest.IO
{
    public class PathHelperTests
    {
        [Fact]
        public void BasePath()
        {
            var bpath = PathHelper.BasePath;

            Assert.NotEmpty(bpath);
            Assert.Equal(bpath, AppDomain.CurrentDomain.BaseDirectory);

            Assert.Equal("config".GetFullPath(), "config".GetBasePath());

            // 改变
            PathHelper.BasePath = "../xx";
            Assert.Equal("../xx/config".GetFullPath(), "config".GetBasePath());

            PathHelper.BasePath = bpath;
        }
    }
}