2019-01-11 23:20:28 +08:00
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Bootstrap.DataAccess
|
|
|
|
|
{
|
2019-01-21 17:33:20 +08:00
|
|
|
|
[Collection("BootstrapAdminTestContext")]
|
|
|
|
|
public class LogsTest
|
2019-01-11 23:20:28 +08:00
|
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public void Save_Ok()
|
|
|
|
|
{
|
|
|
|
|
var log = new Log()
|
|
|
|
|
{
|
|
|
|
|
UserName = "UnitTest",
|
|
|
|
|
ClientAgent = "UnitTest-Agent",
|
|
|
|
|
ClientIp = "::",
|
|
|
|
|
CRUD = "UnitTest",
|
|
|
|
|
RequestUrl = "~/Home/Index"
|
|
|
|
|
};
|
|
|
|
|
Assert.True(log.Save(log));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void Retrieves_Ok()
|
|
|
|
|
{
|
2019-01-12 19:23:10 +08:00
|
|
|
|
var log = new Log()
|
|
|
|
|
{
|
|
|
|
|
UserName = "UnitTest",
|
|
|
|
|
ClientAgent = "UnitTest-Agent",
|
|
|
|
|
ClientIp = "::",
|
|
|
|
|
CRUD = "UnitTest",
|
|
|
|
|
RequestUrl = "~/Home/Index"
|
|
|
|
|
};
|
|
|
|
|
log.Save(log);
|
2019-01-11 23:20:28 +08:00
|
|
|
|
Assert.NotEmpty(log.Retrieves());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|