2019-06-01 16:57:33 +08:00
|
|
|
|
using Longbow.Web.Mvc;
|
2019-05-18 21:21:03 +08:00
|
|
|
|
using Microsoft.Data.Sqlite;
|
2019-01-11 23:20:28 +08:00
|
|
|
|
using System;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
2019-05-15 00:22:13 +08:00
|
|
|
|
namespace Bootstrap.DataAccess.SqlServer
|
2019-01-11 23:20:28 +08:00
|
|
|
|
{
|
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 Retrieves_Ok()
|
|
|
|
|
{
|
2019-05-18 21:21:03 +08:00
|
|
|
|
ExceptionsHelper.Log(new Exception("UnitTest", new SqliteException("UnitTest", 1001)), null);
|
2019-05-14 15:08:46 +08:00
|
|
|
|
Assert.NotEmpty(ExceptionsHelper.Retrieves());
|
2019-05-18 21:21:03 +08:00
|
|
|
|
|
2019-06-01 16:57:33 +08:00
|
|
|
|
var ex = new Exceptions() { Period = "1" };
|
2019-05-18 21:21:03 +08:00
|
|
|
|
Assert.Equal("1", ex.Period);
|
2019-01-11 23:20:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void RetrievePages_Ok()
|
|
|
|
|
{
|
2019-05-18 21:21:03 +08:00
|
|
|
|
Assert.NotNull(ExceptionsHelper.RetrievePages(new PaginationOption() { Offset = 0, Limit = 20, Sort = "LogTime", Order = "desc" }, null, null));
|
|
|
|
|
Assert.NotNull(ExceptionsHelper.RetrievePages(new PaginationOption() { Offset = 0, Limit = 20, Sort = "ErrorPage", Order = "desc" }, null, null));
|
|
|
|
|
Assert.NotNull(ExceptionsHelper.RetrievePages(new PaginationOption() { Offset = 0, Limit = 20, Sort = "UserId", Order = "desc" }, null, null));
|
|
|
|
|
Assert.NotNull(ExceptionsHelper.RetrievePages(new PaginationOption() { Offset = 0, Limit = 20, Sort = "UserIp", Order = "desc" }, null, null));
|
2019-01-11 23:20:28 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|