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

namespace XUnitTest.Net
{
    public class UpgradeTests
    {
        [Fact]
        public void CopyAndReplace()
        {
            //Directory.Delete("./Update", true);

            var url = "http://x.newlifex.com/star/staragent50.zip";
            var fileName = Path.GetFileName(url);
            //fileName = "Update".CombinePath(fileName).EnsureDirectory(true);

            var ug = new Upgrade { Log = XTrace.Log };
            ug.Download(url, fileName);

            // 解压
            var source = ug.Extract(ug.SourceFile);

            // 覆盖
            var dest = "./updateTest";
            ug.CopyAndReplace(source, dest);
        }
    }
}