单元测试:MenusTest删除方法完善,先插入再删除数据

This commit is contained in:
Argo-Surface 2019-01-12 11:44:57 +08:00
parent 8361a4cd4c
commit ef0f048bbc
1 changed files with 14 additions and 3 deletions

View File

@ -18,7 +18,6 @@ namespace Bootstrap.DataAccess
Order = 10,
Url = "#",
ParentId = "0"
};
Assert.True(m.Save(m));
}
@ -33,8 +32,20 @@ namespace Bootstrap.DataAccess
[Fact]
public void Delete_Ok()
{
var m = new Menu();
Assert.True(m.Delete(new string[] { "452" }));
var m = new Menu()
{
Name = "UnitTest",
Application = "0",
Category = "0",
Icon = "fa fa-fa",
IsResource = 0,
Target = "_blank",
Order = 10,
Url = "#",
ParentId = "0"
};
m.Save(m);
Assert.True(m.Delete(new string[] { m.Id }));
}
[Fact]