mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-12-22 14:05:48 +08:00
style: 💄 code format
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
namespace NetAdmin.Infrastructure.Extensions;
|
||||
namespace NetAdmin.Infrastructure.Extensions;
|
||||
|
||||
/// <summary>
|
||||
/// ISelect 扩展方法
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<PackageReference Include="Minio" Version="6.0.3"/>
|
||||
<PackageReference Include="NSExt" Version="2.3.2"/>
|
||||
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4"/>
|
||||
<PackageReference Include="System.Drawing.Common" Version="9.0.0"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<!--<ProjectReference Include="$(SolutionDir)/refs/NetAdmin.FreeSql/src/FreeSql.DbContext/FreeSql.DbContext.csproj" Label="refs"/>-->
|
||||
|
||||
@@ -18,7 +18,7 @@ public sealed class RequestLogCache(IDistributedCache cache, IRequestLogService
|
||||
public async Task<long> CountAsync(QueryReq<QueryRequestLogReq> req)
|
||||
#else
|
||||
public Task<long> CountAsync(QueryReq<QueryRequestLogReq> req)
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
#if !DEBUG
|
||||
var ret = await GetOrCreateAsync( //
|
||||
|
||||
183
src/backend/UnitTests/Sys/DocTests.cs
Normal file
183
src/backend/UnitTests/Sys/DocTests.cs
Normal file
@@ -0,0 +1,183 @@
|
||||
using NetAdmin.Domain.Dto.Sys.Doc.Catalog;
|
||||
using NetAdmin.Domain.Dto.Sys.Doc.Content;
|
||||
|
||||
namespace UnitTests.Sys;
|
||||
|
||||
/// <summary>
|
||||
/// 文档测试
|
||||
/// </summary>
|
||||
[SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters")]
|
||||
[SuppressMessage("Usage", "xUnit1028:Test method must have valid return type")]
|
||||
public class DocTests(WebTestApplicationFactory<Startup> factory, ITestOutputHelper testOutputHelper)
|
||||
: WebApiTestBase<Startup>(factory, testOutputHelper), IDocModule
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<int> BulkDeleteCatalogAsync(BulkReq<DelReq> req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<int> BulkDeleteContentAsync(BulkReq<DelReq> req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<QueryDocCatalogRsp> CreateCatalogAsync(CreateDocCatalogReq req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<QueryDocContentRsp> CreateContentAsync(CreateDocContentReq req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<int> DeleteCatalogAsync(DelReq req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<int> DeleteContentAsync(DelReq req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<int> EditCatalogAsync(EditDocCatalogReq req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<QueryDocContentRsp> EditContentAsync(EditDocContentReq req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<IActionResult> ExportContentAsync(QueryReq<QueryDocContentReq> req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<QueryDocCatalogRsp> GetCatalogAsync(QueryDocCatalogReq req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<QueryDocContentRsp> GetContentAsync(QueryDocContentReq req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<PagedQueryRsp<QueryDocCatalogRsp>> PagedQueryCatalogAsync(PagedQueryReq<QueryDocCatalogReq> req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<PagedQueryRsp<QueryDocContentRsp>> PagedQueryContentAsync(PagedQueryReq<QueryDocContentReq> req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<IEnumerable<QueryDocCatalogRsp>> QueryCatalogAsync(QueryReq<QueryDocCatalogReq> req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<IEnumerable<QueryDocContentRsp>> QueryContentAsync(QueryReq<QueryDocContentReq> req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<int> SetEnabledAsync(SetDocContentEnabledReq req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[InlineData(default)]
|
||||
[Theory]
|
||||
public async Task<QueryDocContentRsp> ViewContentAsync(QueryDocContentReq req)
|
||||
{
|
||||
var rsp = await PostJsonAsync(typeof(DocController), req);
|
||||
Assert.True(rsp.IsSuccessStatusCode);
|
||||
return default;
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,4 @@
|
||||
<ProjectReference Include="../YourSolution.AdmServer.Domain/YourSolution.AdmServer.Domain.csproj"/>
|
||||
<ProjectReference Include="../NetAdmin/NetAdmin.SysComponent.Application/NetAdmin.SysComponent.Application.csproj"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MailKit" Version="4.8.0"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user