mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 14:04:32 +08:00
63 lines
1.6 KiB
C#
63 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Xunit;
|
|
|
|
namespace SKIT.FlurlHttpClient.Wechat.Ads.UnitTests
|
|
{
|
|
public class WechatAdsDeclarationTests
|
|
{
|
|
private static readonly Assembly _assembly = Assembly.Load("SKIT.FlurlHttpClient.Wechat.Ads");
|
|
|
|
[Fact(DisplayName = "验证 API 模型命名")]
|
|
public void ApiModelsNamingTest()
|
|
{
|
|
CodeStyleUtil.VerifyApiModelsNaming(_assembly, out var ex);
|
|
|
|
if (ex != null)
|
|
throw ex;
|
|
|
|
Assert.Null(ex);
|
|
}
|
|
|
|
[Fact(DisplayName = "验证 API 模型定义")]
|
|
public void ApiModelsDefinitionTest()
|
|
{
|
|
string workdir = Path.Combine(TestConfigs.ProjectTestDirectory, "ModelSamples");
|
|
CodeStyleUtil.VerifyApiModelsDefinition(_assembly, workdir, out var ex);
|
|
|
|
if (ex != null)
|
|
throw ex;
|
|
|
|
Assert.Null(ex);
|
|
}
|
|
|
|
[Fact(DisplayName = "验证 API 接口命名")]
|
|
public void ApiExtensionsNamingTest()
|
|
{
|
|
CodeStyleUtil.VerifyApiExtensionsNaming(_assembly, out var ex);
|
|
|
|
if (ex != null)
|
|
throw ex;
|
|
|
|
Assert.Null(ex);
|
|
}
|
|
|
|
[Fact(DisplayName = "验证代码规范")]
|
|
public void CodeStyleTest()
|
|
{
|
|
string workdir = Path.Combine(TestConfigs.ProjectSourceDirectory);
|
|
CodeStyleUtil.VerifySourceCodeStyle(workdir, out var ex);
|
|
|
|
if (ex != null)
|
|
throw ex;
|
|
|
|
Assert.Null(ex);
|
|
}
|
|
}
|
|
}
|