2019-01-11 23:20:28 +08:00
|
|
|
using Longbow.Web.Mvc;
|
|
|
|
using System;
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace Bootstrap.DataAccess
|
|
|
|
{
|
2019-01-24 17:58:06 +08:00
|
|
|
[Collection("SQLServerContext")]
|
2019-01-21 17:33:20 +08:00
|
|
|
public class ExceptionsTest
|
2019-01-11 23:20:28 +08:00
|
|
|
{
|
|
|
|
[Fact]
|
|
|
|
public void Log_Ok()
|
|
|
|
{
|
|
|
|
Exceptions excep = new Exceptions();
|
|
|
|
Assert.True(excep.Log(new Exception("UnitTest"), null));
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public void Retrieves_Ok()
|
|
|
|
{
|
|
|
|
Exceptions excep = new Exceptions();
|
2019-01-12 19:23:10 +08:00
|
|
|
excep.Log(new Exception("UnitTest"), null);
|
2019-01-11 23:20:28 +08:00
|
|
|
Assert.NotEmpty(excep.Retrieves());
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public void RetrievePages_Ok()
|
|
|
|
{
|
|
|
|
var excep = new Exceptions();
|
|
|
|
var op = excep.RetrievePages(new PaginationOption() { Offset = 0, Limit = 20, Sort = "LogTime", Order = "desc" }, null, null);
|
|
|
|
Assert.NotNull(op);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|