2019-05-18 21:21:03 +08:00
|
|
|
|
using System;
|
|
|
|
|
using Xunit;
|
2019-01-11 23:20:28 +08:00
|
|
|
|
|
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 MessagesTest
|
2019-01-11 23:20:28 +08:00
|
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public void RetrieveHeaders_Ok()
|
|
|
|
|
{
|
2019-05-14 15:08:46 +08:00
|
|
|
|
Assert.NotNull(MessageHelper.Retrieves("Admin"));
|
2019-01-11 23:20:28 +08:00
|
|
|
|
}
|
2019-05-18 21:21:03 +08:00
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public virtual void Save_Ok()
|
|
|
|
|
{
|
|
|
|
|
var msg = new Message()
|
|
|
|
|
{
|
|
|
|
|
Content = "UnitTest",
|
|
|
|
|
From = "Admin",
|
|
|
|
|
Label = "Test",
|
|
|
|
|
IsDelete = 0,
|
|
|
|
|
Flag = 0,
|
|
|
|
|
Period = "1",
|
|
|
|
|
SendTime = DateTime.Now,
|
|
|
|
|
Status = "0",
|
|
|
|
|
Title = "Test",
|
|
|
|
|
To = "User",
|
|
|
|
|
LabelName = "UnitTest",
|
|
|
|
|
FromDisplayName = "UnitTest",
|
|
|
|
|
FromIcon = "Default.jpg"
|
|
|
|
|
};
|
|
|
|
|
Assert.True(MessageHelper.Save(msg));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2019-01-11 23:20:28 +08:00
|
|
|
|
}
|
|
|
|
|
}
|