From 1ca9cae5141695a6463a8a43ce3b57e209e43594 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 11 Oct 2021 22:52:15 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E4=BC=98=E5=8C=96=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CodeStyleUtil.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/SKIT.FlurlHttpClient.Wechat.TestTools/CodeStyleUtil.cs b/test/SKIT.FlurlHttpClient.Wechat.TestTools/CodeStyleUtil.cs index 3c0c9459..c02a3569 100644 --- a/test/SKIT.FlurlHttpClient.Wechat.TestTools/CodeStyleUtil.cs +++ b/test/SKIT.FlurlHttpClient.Wechat.TestTools/CodeStyleUtil.cs @@ -145,7 +145,7 @@ namespace SKIT.FlurlHttpClient.Wechat string json = File.ReadAllText(file); string name = Path.GetFileNameWithoutExtension(file).Split('.')[0]; - Type type = assembly.GetType($"{assembly.GetName().Name}.Models.{name}"); + Type type = assembly.GetTypes().SingleOrDefault(e => e.FullName.StartsWith($"{assembly.GetName().Name}.Models.") && e.Name == name); if (type == null) { lstError.Add(new Exception($"类型 `{name}`不存在。")); @@ -192,7 +192,7 @@ namespace SKIT.FlurlHttpClient.Wechat string json = File.ReadAllText(file); string name = Path.GetFileNameWithoutExtension(file).Split('.')[0]; - Type type = assembly.GetType($"{assembly.GetName().Name}.Events.{name}"); + Type type = assembly.GetTypes().SingleOrDefault(e => e.FullName.StartsWith($"{assembly.GetName().Name}.Events.") && e.Name == name); if (type == null) { lstError.Add(new Exception($"类型 `{name}`不存在。")); @@ -209,8 +209,8 @@ namespace SKIT.FlurlHttpClient.Wechat { string xml = File.ReadAllText(file); string name = Path.GetFileNameWithoutExtension(file).Split('.')[0]; - - Type type = assembly.GetType($"{assembly.GetName().Name}.Events.{name}"); + + Type type = assembly.GetTypes().SingleOrDefault(e => e.FullName.StartsWith($"{assembly.GetName().Name}.Events.") && e.Name == name); if (type == null) { lstError.Add(new Exception($"类型 `{name}`不存在。"));