From c43d6be08957a35647b7d7c8beacc80b33845d27 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 9 Oct 2019 23:08:55 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0=20LogHelper.DbLogTas?= =?UTF-8?q?k=20=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appveyor.test.ps1 | 2 +- .../SQLite/LogHelperTest.cs | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 test/UnitTest/Bootstrap.DataAccess/SQLite/LogHelperTest.cs diff --git a/appveyor.test.ps1 b/appveyor.test.ps1 index d7223364..176dc19c 100644 --- a/appveyor.test.ps1 +++ b/appveyor.test.ps1 @@ -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() { diff --git a/test/UnitTest/Bootstrap.DataAccess/SQLite/LogHelperTest.cs b/test/UnitTest/Bootstrap.DataAccess/SQLite/LogHelperTest.cs new file mode 100644 index 00000000..7dcb533e --- /dev/null +++ b/test/UnitTest/Bootstrap.DataAccess/SQLite/LogHelperTest.cs @@ -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); + } + } +}