test: 增加 LogHelper.DbLogTask 单元测试
This commit is contained in:
parent
1447d52072
commit
c43d6be089
|
@ -38,7 +38,7 @@
|
|||
|
||||
function runUnitTest() {
|
||||
write-host "dotnet test test\UnitTest" -ForegroundColor Cyan
|
||||
dotnet test test\UnitTest --filter="FullyQualifiedName!~MySql" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Bootstrap.Admin*]*%2c[Bootstrap.DataAccess*]*" /p:Exclude="[*]*Program%2c[*]*Startup%2c[Bootstrap.DataAccess]*AutoDB%2c[Bootstrap.DataAccess]*WeChatHelper%2c[Bootstrap.DataAccess]*DbLogTask" /p:ExcludeByFile="**/SMSExtensions.cs%2c**/Helper/OAuthHelper.cs" /p:CoverletOutput=..\..\
|
||||
dotnet test test\UnitTest --filter="FullyQualifiedName!~MySql" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Bootstrap.Admin*]*%2c[Bootstrap.DataAccess*]*" /p:Exclude="[*]*Program%2c[*]*Startup%2c[Bootstrap.DataAccess]*AutoDB%2c[Bootstrap.DataAccess]*WeChatHelper" /p:ExcludeByFile="**/SMSExtensions.cs%2c**/Helper/OAuthHelper.cs" /p:CoverletOutput=..\..\
|
||||
}
|
||||
|
||||
function coverallUnitTest() {
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using Xunit;
|
||||
|
||||
namespace Bootstrap.DataAccess.SQLite
|
||||
{
|
||||
[Collection("SQLiteContext")]
|
||||
public class LogHelperTest
|
||||
{
|
||||
[Fact]
|
||||
public void Task_Ok()
|
||||
{
|
||||
var log = new DBLog()
|
||||
{
|
||||
Id = "",
|
||||
LogTime = DateTime.Now,
|
||||
SQL = "UnitTest",
|
||||
UserName = "Admin"
|
||||
};
|
||||
LogHelper.AddDBLog(log);
|
||||
var task = new LogHelper.DbLogTask();
|
||||
task.Execute(CancellationToken.None);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue