mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-20 10:38:10 +08:00
test: 提取公共测试流程
This commit is contained in:
27
test/SKIT.FlurlHttpClient.Wechat.TestTools/TestIOUtil.cs
Normal file
27
test/SKIT.FlurlHttpClient.Wechat.TestTools/TestIOUtil.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat
|
||||
{
|
||||
public static class TestIOUtil
|
||||
{
|
||||
public static string[] GetAllFiles(string path)
|
||||
{
|
||||
if (path == null) throw new ArgumentNullException(nameof(path));
|
||||
|
||||
List<string> results = new List<string>();
|
||||
string[] dirs = Directory.GetDirectories(path);
|
||||
string[] files = Directory.GetFiles(path);
|
||||
|
||||
results.AddRange(files);
|
||||
|
||||
foreach (string dir in dirs)
|
||||
{
|
||||
results.AddRange(GetAllFiles(dir));
|
||||
}
|
||||
|
||||
return results.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user