This commit is contained in:
Fu Diwei 2021-11-29 11:53:38 +08:00
parent 70a5a5a0b3
commit d95b1026a1
10 changed files with 15 additions and 15 deletions

View File

@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Ads.UnitTests
using var stream = File.OpenRead("appsettings.local.json"); using var stream = File.OpenRead("appsettings.local.json");
using var jdoc = JsonDocument.Parse(stream); using var jdoc = JsonDocument.Parse(stream);
var config = jdoc.RootElement.GetProperty("WechatConfig"); var config = jdoc.RootElement.GetProperty("TestConfig");
WechatAgencyId = config.GetProperty("AgencyId").GetString(); WechatAgencyId = config.GetProperty("AgencyId").GetString();
WechatAgencyAppId = config.GetProperty("AgencyAppId").GetString(); WechatAgencyAppId = config.GetProperty("AgencyAppId").GetString();
WechatAgencyApiKey = config.GetProperty("AgencyApiKey").GetString(); WechatAgencyApiKey = config.GetProperty("AgencyApiKey").GetString();
@ -27,7 +27,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Ads.UnitTests
} }
catch (Exception ex) catch (Exception ex)
{ {
throw new Exception("加载配置文件 appsettings.local.json 失败", ex); throw new Exception("加载配置文件 appsettings.local.json 失败,请查看 `InnerException` 了解具体失败原因", ex);
} }
} }

View File

@ -1,5 +1,5 @@
{ {
"WechatConfig": { "TestConfig": {
"AgencyId": "请在此填写用于测试的微信广告 AgencyId", "AgencyId": "请在此填写用于测试的微信广告 AgencyId",
"AgencyAppId": "请在此填写用于测试的微信广告 AgencyAppId", "AgencyAppId": "请在此填写用于测试的微信广告 AgencyAppId",
"AgencyApiKey": "请在此填写用于测试的微信广告 AgencyApiKey", "AgencyApiKey": "请在此填写用于测试的微信广告 AgencyApiKey",

View File

@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests
using var stream = File.OpenRead("appsettings.local.json"); using var stream = File.OpenRead("appsettings.local.json");
using var jdoc = JsonDocument.Parse(stream); using var jdoc = JsonDocument.Parse(stream);
var config = jdoc.RootElement.GetProperty("WechatConfig"); var config = jdoc.RootElement.GetProperty("TestConfig");
WechatAppId = config.GetProperty("AppId").GetString(); WechatAppId = config.GetProperty("AppId").GetString();
WechatAppSecret = config.GetProperty("AppSecret").GetString(); WechatAppSecret = config.GetProperty("AppSecret").GetString();
WechatAccessToken = config.GetProperty("AccessToken").GetString(); WechatAccessToken = config.GetProperty("AccessToken").GetString();
@ -27,7 +27,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests
} }
catch (Exception ex) catch (Exception ex)
{ {
throw new Exception("加载配置文件 appsettings.local.json 失败", ex); throw new Exception("加载配置文件 appsettings.local.json 失败,请查看 `InnerException` 了解具体失败原因", ex);
} }
} }

View File

@ -1,5 +1,5 @@
{ {
"WechatConfig": { "TestConfig": {
"AppId": "请在此填写用于测试的微信 AppId", "AppId": "请在此填写用于测试的微信 AppId",
"AppSecret": "请在此填写用于测试的微信 AppSecret", "AppSecret": "请在此填写用于测试的微信 AppSecret",
"AccessToken": "请在此填写用于测试的微信 AccessToken", "AccessToken": "请在此填写用于测试的微信 AccessToken",

View File

@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
using var stream = File.OpenRead("appsettings.local.json"); using var stream = File.OpenRead("appsettings.local.json");
using var jdoc = JsonDocument.Parse(stream); using var jdoc = JsonDocument.Parse(stream);
var config = jdoc.RootElement.GetProperty("WechatConfig"); var config = jdoc.RootElement.GetProperty("TestConfig");
WechatClientId = config.GetProperty("ClientId").GetString(); WechatClientId = config.GetProperty("ClientId").GetString();
WechatClientKey = config.GetProperty("ClientKey").GetString(); WechatClientKey = config.GetProperty("ClientKey").GetString();
WechatAppId = config.GetProperty("AppId").GetString(); WechatAppId = config.GetProperty("AppId").GetString();
@ -29,7 +29,7 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests
} }
catch (Exception ex) catch (Exception ex)
{ {
throw new Exception("加载配置文件 appsettings.local.json 失败", ex); throw new Exception("加载配置文件 appsettings.local.json 失败,请查看 `InnerException` 了解具体失败原因", ex);
} }
} }

View File

@ -1,5 +1,5 @@
{ {
"WechatConfig": { "TestConfig": {
"ClientId": "请在此填写用于测试的微信智能对话 ClientId", "ClientId": "请在此填写用于测试的微信智能对话 ClientId",
"ClientKey": "请在此填写用于测试的微信智能对话 ClientKey", "ClientKey": "请在此填写用于测试的微信智能对话 ClientKey",
"AppId": "请在此填写用于测试的微信智能对话 AppId", "AppId": "请在此填写用于测试的微信智能对话 AppId",

View File

@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
using var stream = File.OpenRead("appsettings.local.json"); using var stream = File.OpenRead("appsettings.local.json");
using var jdoc = JsonDocument.Parse(stream); using var jdoc = JsonDocument.Parse(stream);
var config = jdoc.RootElement.GetProperty("WechatConfig"); var config = jdoc.RootElement.GetProperty("TestConfig");
WechatAppId = config.GetProperty("AppId").GetString(); WechatAppId = config.GetProperty("AppId").GetString();
WechatMerchantId = config.GetProperty("MerchantId").GetString(); WechatMerchantId = config.GetProperty("MerchantId").GetString();
WechatMerchantSecret = config.GetProperty("MerchantSecret").GetString(); WechatMerchantSecret = config.GetProperty("MerchantSecret").GetString();
@ -29,7 +29,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.UnitTests
} }
catch (Exception ex) catch (Exception ex)
{ {
throw new Exception("加载配置文件 appsettings.local.json 失败", ex); throw new Exception("加载配置文件 appsettings.local.json 失败,请查看 `InnerException` 了解具体失败原因", ex);
} }
} }

View File

@ -1,5 +1,5 @@
{ {
"WechatConfig": { "TestConfig": {
"AppId": "请在此填写用于测试的微信 AppId", "AppId": "请在此填写用于测试的微信 AppId",
"MerchantId": "请在此填写用于测试的微信商户号", "MerchantId": "请在此填写用于测试的微信商户号",
"MerchantSecret": "请在此填写用于测试的微信商户 API v3 密钥", "MerchantSecret": "请在此填写用于测试的微信商户 API v3 密钥",

View File

@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.UnitTests
using var stream = File.OpenRead("appsettings.local.json"); using var stream = File.OpenRead("appsettings.local.json");
using var jdoc = JsonDocument.Parse(stream); using var jdoc = JsonDocument.Parse(stream);
var config = jdoc.RootElement.GetProperty("WechatConfig"); var config = jdoc.RootElement.GetProperty("TestConfig");
WechatCorpId = config.GetProperty("CorpId").GetString(); WechatCorpId = config.GetProperty("CorpId").GetString();
WechatAgentId = int.Parse(config.GetProperty("AgentId").GetString()); WechatAgentId = int.Parse(config.GetProperty("AgentId").GetString());
WechatAgentSecret = config.GetProperty("AgentSecret").GetString(); WechatAgentSecret = config.GetProperty("AgentSecret").GetString();
@ -26,7 +26,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.UnitTests
} }
catch (Exception ex) catch (Exception ex)
{ {
throw new Exception("加载配置文件 appsettings.local.json 失败", ex); throw new Exception("加载配置文件 appsettings.local.json 失败,请查看 `InnerException` 了解具体失败原因", ex);
} }
} }

View File

@ -1,5 +1,5 @@
{ {
"WechatConfig": { "TestConfig": {
"CorpId": "请在此填写用于测试的企业微信 CorpId", "CorpId": "请在此填写用于测试的企业微信 CorpId",
"AgentId": "请在此填写用于测试的企业微信 AgentId", "AgentId": "请在此填写用于测试的企业微信 AgentId",
"AgentSecret": "请在此填写用于测试的企业微信 AgentSecret" "AgentSecret": "请在此填写用于测试的企业微信 AgentSecret"