diff --git a/UnitTest/Bootstrap.Admin/Api/AppsTest.cs b/UnitTest/Bootstrap.Admin/Api/AppsTest.cs new file mode 100644 index 00000000..18a9b731 --- /dev/null +++ b/UnitTest/Bootstrap.Admin/Api/AppsTest.cs @@ -0,0 +1,28 @@ +using Bootstrap.DataAccess; +using System.Collections.Generic; +using System.Linq; +using Xunit; + +namespace Bootstrap.Admin.Api +{ + public class AppsTest : ControllerTest + { + public AppsTest(BAWebHost factory) : base(factory, "api/Apps") { } + + [Fact] + public async void Post_Ok() + { + var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id; + var cates = await Client.PostAsJsonAsync>(rid, string.Empty); + Assert.NotEmpty(cates); + } + + [Fact] + public async void Put_Ok() + { + var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id; + var ret = await Client.PutAsJsonAsync, bool>(rid, new string[] { "1", "2" }); + Assert.True(ret); + } + } +} diff --git a/UnitTest/Bootstrap.Admin/Api/MySql/AppsTest.cs b/UnitTest/Bootstrap.Admin/Api/MySql/AppsTest.cs new file mode 100644 index 00000000..cb8a9157 --- /dev/null +++ b/UnitTest/Bootstrap.Admin/Api/MySql/AppsTest.cs @@ -0,0 +1,10 @@ +using Xunit; + +namespace Bootstrap.Admin.Api.MySql +{ + [Collection("MySqlContext")] + public class AppsTest : Api.AppsTest + { + public AppsTest(MySqlBAWebHost factory) : base(factory) { } + } +} diff --git a/UnitTest/Bootstrap.Admin/Api/SQLite/AppsTest.cs b/UnitTest/Bootstrap.Admin/Api/SQLite/AppsTest.cs new file mode 100644 index 00000000..2de464b0 --- /dev/null +++ b/UnitTest/Bootstrap.Admin/Api/SQLite/AppsTest.cs @@ -0,0 +1,10 @@ +using Xunit; + +namespace Bootstrap.Admin.Api.SQLite +{ + [Collection("SQLiteContext")] + public class AppsTest : Api.CategoryTest + { + public AppsTest(SQLiteBAWebHost factory) : base(factory) { } + } +} diff --git a/UnitTest/DB/UnitTest.db b/UnitTest/DB/UnitTest.db index 57a2d338..52b942db 100644 Binary files a/UnitTest/DB/UnitTest.db and b/UnitTest/DB/UnitTest.db differ