diff --git a/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Options/WechatOptions.cs b/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Options/WechatOptions.cs index ae90f871..676d56ea 100644 --- a/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Options/WechatOptions.cs +++ b/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Options/WechatOptions.cs @@ -14,7 +14,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Sample.Options public string CallbackToken { get; set; } = string.Empty; } - partial class WechatOptions + public partial class WechatOptions { public static class Types { diff --git a/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Services/BackgroundServices/WechatAccessTokenRefreshingBackgroundService.cs b/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Services/BackgroundServices/WechatAccessTokenRefreshingBackgroundService.cs index f1b07079..1e9a8461 100644 --- a/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Services/BackgroundServices/WechatAccessTokenRefreshingBackgroundService.cs +++ b/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Services/BackgroundServices/WechatAccessTokenRefreshingBackgroundService.cs @@ -12,7 +12,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Sample.Services.BackgroundServices using SKIT.FlurlHttpClient.Wechat.Api; using SKIT.FlurlHttpClient.Wechat.Api.Models; - class WechatAccessTokenRefreshingBackgroundService : BackgroundService + internal class WechatAccessTokenRefreshingBackgroundService : BackgroundService { private readonly ILogger _logger; private readonly Options.WechatOptions _wechatOptions; @@ -70,7 +70,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Sample.Services.BackgroundServices if (!response.IsSuccessful()) { _logger.LogWarning( - "刷新 AppId 为 {0} 微信 AccessToken 失败(状态码:{1},错误代码:{2},错误描述:{3})。", + "刷新 AppId 为 {0} 微信 AccessToken 失败(状态码:{1},错误代码:{2},错误描述:{3})。", appId, response.RawStatus, response.ErrorCode, response.ErrorMessage ); return; // 请求失败 diff --git a/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Services/DistributedLock/Implements/DistributedLockFactory.cs b/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Services/DistributedLock/Implements/DistributedLockFactory.cs index f8a2f238..717f730a 100644 --- a/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Services/DistributedLock/Implements/DistributedLockFactory.cs +++ b/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Services/DistributedLock/Implements/DistributedLockFactory.cs @@ -5,7 +5,7 @@ using Medallion.Threading.FileSystem; namespace SKIT.FlurlHttpClient.Wechat.Api.Sample.Services.DistributedLock.Implements { - class DistributedLockFactory : IDistributedLockFactory + internal class DistributedLockFactory : IDistributedLockFactory { private readonly DirectoryInfo _lockFileDirectory = new DirectoryInfo(Environment.CurrentDirectory); diff --git a/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Services/HttpClients/Implements/WechatApiHttpClientFactory.cs b/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Services/HttpClients/Implements/WechatApiHttpClientFactory.cs index ed1a4539..b12db1f5 100644 --- a/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Services/HttpClients/Implements/WechatApiHttpClientFactory.cs +++ b/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Services/HttpClients/Implements/WechatApiHttpClientFactory.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.Options; namespace SKIT.FlurlHttpClient.Wechat.Api.Sample.Services.HttpClients.Implements { - partial class WechatApiHttpClientFactory : IWechatApiHttpClientFactory + internal partial class WechatApiHttpClientFactory : IWechatApiHttpClientFactory { private readonly IHttpClientFactory _httpClientFactory; private readonly Options.WechatOptions _wechatOptions; @@ -40,7 +40,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Sample.Services.HttpClients.Implements } } - partial class WechatApiHttpClientFactory + internal partial class WechatApiHttpClientFactory { internal class DelegatingFlurlClientFactory : Flurl.Http.Configuration.DefaultHttpClientFactory { diff --git a/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Startup.cs b/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Startup.cs index 8fa8ee20..557fd7ee 100644 --- a/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Startup.cs +++ b/samples/SKIT.FlurlHttpClient.Wechat.Api.Sample_Net6/Startup.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/Newtonsoft.Json/Array[String]/TextualStringArrayWithPipeSplitConverter.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/Newtonsoft.Json/Array[String]/TextualStringArrayWithPipeSplitConverter.cs index b188a8a0..4ee5f811 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/Newtonsoft.Json/Array[String]/TextualStringArrayWithPipeSplitConverter.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/Newtonsoft.Json/Array[String]/TextualStringArrayWithPipeSplitConverter.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; namespace Newtonsoft.Json.Converters { diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/Newtonsoft.Json/Array[String]/TextualStringArrayWithSemicolonSplitConverter.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/Newtonsoft.Json/Array[String]/TextualStringArrayWithSemicolonSplitConverter.cs index d1486db0..ff051e2c 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/Newtonsoft.Json/Array[String]/TextualStringArrayWithSemicolonSplitConverter.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/Newtonsoft.Json/Array[String]/TextualStringArrayWithSemicolonSplitConverter.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; namespace Newtonsoft.Json.Converters { diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/System.Text.Json/Array[String]/TextualStringArrayWithPipeSplitConverter.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/System.Text.Json/Array[String]/TextualStringArrayWithPipeSplitConverter.cs index 4e51fc92..6d567988 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/System.Text.Json/Array[String]/TextualStringArrayWithPipeSplitConverter.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/System.Text.Json/Array[String]/TextualStringArrayWithPipeSplitConverter.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text.Json.Serialization; +using System.Text.Json.Serialization; namespace System.Text.Json.Converters { diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/System.Text.Json/Array[String]/TextualStringArrayWithSemicolonSplitConverter.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/System.Text.Json/Array[String]/TextualStringArrayWithSemicolonSplitConverter.cs index 28e438d7..bd942655 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/System.Text.Json/Array[String]/TextualStringArrayWithSemicolonSplitConverter.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Converters/Internal/System.Text.Json/Array[String]/TextualStringArrayWithSemicolonSplitConverter.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text.Json.Serialization; +using System.Text.Json.Serialization; namespace System.Text.Json.Converters { diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/NearybyPOI/WxaAddNearbyPOIRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/NearybyPOI/WxaAddNearbyPOIRequest.cs index da166564..0e0dc326 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/NearybyPOI/WxaAddNearbyPOIRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/NearybyPOI/WxaAddNearbyPOIRequest.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; namespace SKIT.FlurlHttpClient.Wechat.Api.Models { diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaAddStoreRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaAddStoreRequest.cs index ec89c391..2c556e78 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaAddStoreRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaAddStoreRequest.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; namespace SKIT.FlurlHttpClient.Wechat.Api.Models { diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaUpdateStoreRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaUpdateStoreRequest.cs index 40a07a18..bd60906d 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaUpdateStoreRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Wxa/WxaStore/WxaUpdateStoreRequest.cs @@ -1,6 +1,4 @@ -using System; - -namespace SKIT.FlurlHttpClient.Wechat.Api.Models +namespace SKIT.FlurlHttpClient.Wechat.Api.Models { /// /// 表示 [POST] /wxa/update_store 接口的请求。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Operation/WxaApiLogGetPerformanceResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Operation/WxaApiLogGetPerformanceResponse.cs index 8a11e890..b98b56e2 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Operation/WxaApiLogGetPerformanceResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaApi/Operation/WxaApiLogGetPerformanceResponse.cs @@ -1,6 +1,4 @@ -using System; - -namespace SKIT.FlurlHttpClient.Wechat.Api.Models +namespace SKIT.FlurlHttpClient.Wechat.Api.Models { /// /// 表示 [POST] /wxaapi/log/get_performance 接口的响应。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaComponent/Code/WxaSubmitAuditRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaComponent/Code/WxaSubmitAuditRequest.cs index aab5e183..bd373775 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaComponent/Code/WxaSubmitAuditRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/WxaComponent/Code/WxaSubmitAuditRequest.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Collections.Generic; namespace SKIT.FlurlHttpClient.Wechat.Api.Models { diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_AESUtilityTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_AESUtilityTests.cs index 773e1df8..f4f9d9b6 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_AESUtilityTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_AESUtilityTests.cs @@ -1,5 +1,4 @@ -using System; -using Xunit; +using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests { @@ -11,10 +10,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests string iv = "KEWv/gyiIwAfHvjrLeaX6w=="; string key = "YZJqKnNFi0KAiKUc0ggC2g=="; string cipherText = "Gu2PVnxVWl+jK4F8c0liGxfkB5Bj3m5HRvwgEIk1Yb+36RZ3Bg7YmUnud/ooiHz0PQroipsH7GCjlGwUeT04NwmrFaP1y3dRYPLpS43ed9QZWcFIFo+8vTs3Zco6S98DUvaNEAs8duhz/BzfBOZaIHMziRqEtPFI0ZDzCgJluBirJ6Wl3UkygZ5/QLo3KA53qGdip7K48Rq8XbCwuidTCw=="; - + string expectedPlainData = "{\"phoneNumber\":\"186****5613\",\"purePhoneNumber\":\"186****5613\",\"countryCode\":\"86\",\"watermark\":{\"timestamp\":1634545675,\"appid\":\"wxc****17e87e0e0a7\"}}"; string actualPlainData = Utilities.AESUtility.DecryptWithCBC(encodingKey: key, encodingIV: iv, encodingCipherText: cipherText); - + Assert.Equal(expectedPlainData, actualPlainData, ignoreCase: true); } } diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCVTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCVTests.cs index 214a372b..459c2fab 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCVTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCVTests.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Threading; using System.Threading.Tasks; using Xunit; diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinMaterialTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinMaterialTests.cs index e3e82109..c505171f 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinMaterialTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinMaterialTests.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; +using System.Linq; using System.Threading.Tasks; using Xunit; diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinMediaTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinMediaTests.cs index 92f9bb39..63db44be 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinMediaTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinMediaTests.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; using System.Threading.Tasks; using Xunit; diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinMessageMassTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinMessageMassTests.cs index abbbda70..5bf07fed 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinMessageMassTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinMessageMassTests.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; +using System.Threading.Tasks; using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests @@ -35,7 +31,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests ToUserOpenId = TestConfigs.WechatOpenId, MessageType = "text", MessageContentForText = new Models.CgibinMessageMassPreviewRequest.Types.TextMessage() - { + { Content = "FAKE_CONTENT" }, AccessToken = TestConfigs.WechatAccessToken diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinQrcodeTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinQrcodeTests.cs index e5ed42b5..d9b3b448 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinQrcodeTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinQrcodeTests.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; +using System.Threading.Tasks; using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests @@ -18,9 +14,9 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests ExpiresIn = 30, ActionType = "QR_STR_SCENE", Action = new Models.CgibinQrcodeCreateRequest.Types.Action() - { + { Scene = new Models.CgibinQrcodeCreateRequest.Types.Action.Types.Scene() - { + { SceneString = "FAKE_SCENESTR" } } diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinTagsTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinTagsTests.cs index eb3138fc..7784a695 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinTagsTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinTagsTests.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; +using System.Linq; using System.Threading.Tasks; using Xunit; @@ -15,9 +12,9 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests var request = new Models.CgibinTagsCreateRequest() { AccessToken = TestConfigs.WechatAccessToken, - Tag = new Models.CgibinTagsCreateRequest.Types.Tag() - { - Name = "FAKE_TAGNAME" + Tag = new Models.CgibinTagsCreateRequest.Types.Tag() + { + Name = "FAKE_TAGNAME" } }; var response = await TestClients.Instance.ExecuteCgibinTagsCreateAsync(request); diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinTests.cs index e293df2a..9931392a 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinTests.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; +using System.Threading.Tasks; using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinUserTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinUserTests.cs index 591b1025..69a686d6 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinUserTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinUserTests.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; +using System.Linq; using System.Threading.Tasks; using Xunit; @@ -20,7 +17,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests var response = await TestClients.Instance.ExecuteCgibinUserInfoAsync(request); Assert.NotEmpty(response.OpenId); - Assert.NotEmpty(response.Nickname); Assert.True(response.IsSubscribed); } @@ -30,8 +26,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests var request = new Models.CgibinUserInfoBatchGetRequest() { AccessToken = TestConfigs.WechatAccessToken, - UserList = new Models.CgibinUserInfoBatchGetRequest.Types.User[] - { + UserList = new Models.CgibinUserInfoBatchGetRequest.Types.User[] + { new Models.CgibinUserInfoBatchGetRequest.Types.User() { OpenId = TestConfigs.WechatOpenId } } }; @@ -39,7 +35,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests Assert.NotEmpty(response.UserList); Assert.NotEmpty(response.UserList.First().OpenId); - Assert.NotEmpty(response.UserList.First().Nickname); Assert.True(response.UserList.First().IsSubscribed); } diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteSemanticTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteSemanticTests.cs index f10253b7..8b1d1b0a 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteSemanticTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteSemanticTests.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; +using System.Threading.Tasks; using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteSnsWithAccessTokenTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteSnsWithAccessTokenTests.cs index 7d1e11f0..3edfb346 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteSnsWithAccessTokenTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteSnsWithAccessTokenTests.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; +using System.Threading.Tasks; using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteSnsWithAppSecretTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteSnsWithAppSecretTests.cs index 710f478f..829259c7 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteSnsWithAppSecretTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteSnsWithAppSecretTests.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; +using System.Threading.Tasks; using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests @@ -34,7 +31,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests Assert.NotNull(response.AccessToken); Assert.NotNull(response.RefreshToken); } - + [Fact(DisplayName = "测试用例:调用 API [GET] /sns/jscode2session")] public async Task TestExecuteSnsJsCode2Session() { diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteWxaApiTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteWxaApiTests.cs index 4839b9c9..af4b77b3 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteWxaApiTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteWxaApiTests.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; using System.Threading.Tasks; using Xunit; diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_CodeReviewAnalyzer.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_CodeReviewAnalyzer.cs index c3b9e4d6..f95386cb 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_CodeReviewAnalyzer.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_CodeReviewAnalyzer.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; +using System.IO; using System.Reflection; -using System.Threading; -using System.Threading.Tasks; using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_DeliveryRequestSignatureTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_DeliveryRequestSignatureTests.cs index b547ed5d..0e69099a 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_DeliveryRequestSignatureTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_DeliveryRequestSignatureTests.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; +using System.Threading.Tasks; using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests @@ -13,7 +9,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests public async Task TestDeliveryRequestSignature() { var client = new WechatApiClient(new WechatApiClientOptions() - { + { AppId = "", AppSecret = "", ImmeDeliveryAppKey = "test_shop_id", diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_EventDeserializationTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_EventDeserializationTests.cs index d64dcf59..13c454ab 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_EventDeserializationTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_EventDeserializationTests.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using System.Xml.Linq; +using System.Xml.Linq; using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_EventVerificationTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_EventVerificationTests.cs index 65c5fad8..76fa5db2 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_EventVerificationTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_EventVerificationTests.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using System.Xml.Linq; -using Xunit; +using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests { diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_HashUtilityTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_HashUtilityTests.cs index 975d5b20..27096caf 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_HashUtilityTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_HashUtilityTests.cs @@ -1,5 +1,4 @@ -using System; -using Xunit; +using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests { diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_MidasRequestSignatureTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_MidasRequestSignatureTests.cs index ae33085d..eaf38e62 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_MidasRequestSignatureTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_MidasRequestSignatureTests.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; +using System.Threading.Tasks; using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests @@ -13,7 +9,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests public async Task TestMidasRequestSignature() { var client = new WechatApiClient(new WechatApiClientOptions() - { + { AppId = "wx1234567", AppSecret = "", MidasAppKey = "zNLgAGgqsEWJOg1nFVaO5r7fAlIQxr1u" diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_WxBizMsgCryptorUtilityTests.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_WxBizMsgCryptorUtilityTests.cs index 050a751f..7cb7e7fe 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_WxBizMsgCryptorUtilityTests.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_WxBizMsgCryptorUtilityTests.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Xunit; +using Xunit; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests { diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestClients.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestClients.cs index 193cb226..cff893f6 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestClients.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestClients.cs @@ -1,15 +1,13 @@ -using System; - -namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests +namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests { - class TestClients + internal class TestClients { static TestClients() { Instance = new WechatApiClient(new WechatApiClientOptions() - { + { AppId = TestConfigs.WechatAppId, - AppSecret = TestConfigs.WechatAppSecret + AppSecret = TestConfigs.WechatAppSecret }); } diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestConfigs.cs b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestConfigs.cs index 935345b5..4c3d861b 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestConfigs.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestConfigs.cs @@ -4,7 +4,7 @@ using System.Text.Json; namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests { - class TestConfigs + internal class TestConfigs { static TestConfigs() {