DotNetCore.SKIT.FlurlHttpCl.../test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/WechatApiDeclarationTests.cs
2021-06-04 21:44:42 +08:00

67 lines
1.8 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.Api.UnitTests
{
public class WechatApiDeclarationTests
{
private static readonly Assembly _assembly = Assembly.Load("SKIT.FlurlHttpClient.Wechat.Api");
[Fact(DisplayName = "验证 API 模型命名")]
public void ApiModelsNamingTest()
{
TestAssertUtil.VerifyApiModelsNaming(_assembly, out var ex);
if (ex != null)
throw ex;
Assert.Null(ex);
}
[Fact(DisplayName = "验证 API 模型定义")]
public void ApiModelsDefinitionTest()
{
string workdir = Path.Combine(Environment.CurrentDirectory, "ModelSamples");
Assert.True(Directory.Exists(workdir));
TestAssertUtil.VerifyApiModelsDefinition(_assembly, workdir, out var ex);
if (ex != null)
throw ex;
Assert.Null(ex);
}
[Fact(DisplayName = "验证 API 事件定义")]
public void ApiEventsDefinitionTest()
{
string workdir = Path.Combine(Environment.CurrentDirectory, "EventSamples");
Assert.True(Directory.Exists(workdir));
TestAssertUtil.VerifyApiEventsDefinition(_assembly, workdir, out var ex);
if (ex != null)
throw ex;
Assert.Null(ex);
}
[Fact(DisplayName = "验证 API 接口命名")]
public void ApiExtensionsNamingTest()
{
TestAssertUtil.VerifyApiExtensionsNaming(_assembly, out var ex);
if (ex != null)
throw ex;
Assert.Null(ex);
}
}
}