单元测试: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, Order = 10,
Url = "#", Url = "#",
ParentId = "0" ParentId = "0"
}; };
Assert.True(m.Save(m)); Assert.True(m.Save(m));
} }
@ -33,8 +32,20 @@ namespace Bootstrap.DataAccess
[Fact] [Fact]
public void Delete_Ok() public void Delete_Ok()
{ {
var m = new Menu(); var m = new Menu()
Assert.True(m.Delete(new string[] { "452" })); {
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] [Fact]