test: 增加空字符串ID保存时单元测试

This commit is contained in:
Argo Window10 2019-12-23 20:32:15 +08:00
parent 22ed63278a
commit a2f043fb05
1 changed files with 25 additions and 1 deletions

View File

@ -1,10 +1,34 @@
using Xunit;
using Bootstrap.Security;
using Xunit;
namespace Bootstrap.DataAccess.MongoDB
{
[Collection("MongoContext")]
public class MenusTest : SqlServer.MenusTest
{
[Fact]
public void Save_EmptyId()
{
var poco = new BootstrapMenu()
{
Id = "",
Name = "UnitTest",
Application = "0",
Category = "0",
Icon = "fa fa-fa",
IsResource = 0,
Target = "_blank",
Order = 10,
Url = "#",
ParentId = "0",
ParentName = "Test"
};
// insert
Assert.True(MenuHelper.Save(poco));
// clean
MenuHelper.Delete(new string[] { poco.Id });
}
}
}