test: 设计代码分析工具,以规避拼写错误导致的 API 定义问题

This commit is contained in:
Fu Diwei
2021-06-07 11:18:27 +08:00
parent d136eb3d09
commit 1b20769099
13 changed files with 219 additions and 34 deletions

View File

@@ -13,16 +13,23 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests
using var stream = File.OpenRead("appsettings.local.json");
using var json = JsonDocument.Parse(stream);
var config = json.RootElement.GetProperty("WechatConfig");
WechatAppId = config.GetProperty("AppId").GetString();
WechatAppSecret = config.GetProperty("AppSecret").GetString();
WechatAccessToken = config.GetProperty("AccessToken").GetString();
WechatOpenId = config.GetProperty("OpenId").GetString();
ProjectSourceDirectory = json.RootElement.GetProperty("ProjectSourceDirectory").GetString();
ProjectTestDirectory = json.RootElement.GetProperty("ProjectTestDirectory").GetString();
}
public static readonly string WechatAppId;
public static readonly string WechatAppSecret;
public static readonly string WechatAccessToken;
public static readonly string WechatOpenId;
public static readonly string ProjectSourceDirectory;
public static readonly string ProjectTestDirectory;
}
}