diff --git a/Bootstrap.Admin/Bootstrap.Admin.csproj b/Bootstrap.Admin/Bootstrap.Admin.csproj index fe8c7d11..b128ffc2 100644 --- a/Bootstrap.Admin/Bootstrap.Admin.csproj +++ b/Bootstrap.Admin/Bootstrap.Admin.csproj @@ -14,7 +14,7 @@ - + diff --git a/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj b/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj index 4d782cc0..4c490177 100644 --- a/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj +++ b/Bootstrap.Client.DataAccess/Bootstrap.Client.DataAccess.csproj @@ -11,9 +11,9 @@ - - - + + + diff --git a/Bootstrap.Client/Bootstrap.Client.csproj b/Bootstrap.Client/Bootstrap.Client.csproj index c910d387..fbe1d9a8 100644 --- a/Bootstrap.Client/Bootstrap.Client.csproj +++ b/Bootstrap.Client/Bootstrap.Client.csproj @@ -10,9 +10,9 @@ - - - + + + diff --git a/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj b/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj index cafabf1f..f9fe432d 100644 --- a/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj +++ b/Bootstrap.DataAccess/Bootstrap.DataAccess.csproj @@ -13,9 +13,9 @@ - + - + diff --git a/UnitTest/Bootstrap.DataAccess/BootstrapAdminStartup.cs b/UnitTest/Bootstrap.DataAccess/BootstrapAdminStartup.cs index a378e5ed..ffb853d2 100644 --- a/UnitTest/Bootstrap.DataAccess/BootstrapAdminStartup.cs +++ b/UnitTest/Bootstrap.DataAccess/BootstrapAdminStartup.cs @@ -1,4 +1,4 @@ -#define SQLite +//#define SQLite //#define MySQL using Microsoft.Extensions.Configuration; diff --git a/UnitTest/Bootstrap.DataAccess/RolesTest.cs b/UnitTest/Bootstrap.DataAccess/RolesTest.cs index 08494178..21559ee4 100644 --- a/UnitTest/Bootstrap.DataAccess/RolesTest.cs +++ b/UnitTest/Bootstrap.DataAccess/RolesTest.cs @@ -1,4 +1,5 @@ -using Xunit; +using System.Linq; +using Xunit; namespace Bootstrap.DataAccess { @@ -45,9 +46,9 @@ namespace Bootstrap.DataAccess public void RetrieveRolesByMenuId_Ok() { var menu = new Menu(); - menu.SaveMenusByRoleId("1", new string[] { "1" }); - var role = new Role(); + var id = role.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id; + menu.SaveMenusByRoleId(id, new string[] { "1" }); var rs = role.RetrievesByMenuId("1"); Assert.Contains(rs, r => r.Checked == "checked"); } @@ -63,6 +64,8 @@ namespace Bootstrap.DataAccess public void RetrieveRolesByGroupId_Ok() { var role = new Role(); + var id = role.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id; + new Group().SaveByRoleId(id, new string[] { "1" }); Assert.Contains(role.RetrievesByGroupId("1"), r => r.Checked == "checked"); } @@ -70,6 +73,8 @@ namespace Bootstrap.DataAccess public void RetrieveRolesByUserName_Ok() { var role = new Role(); + var id = role.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id; + new User().SaveByRoleId(id, new string[] { "1" }); Assert.NotEmpty(role.RetrieveRolesByUserName("Admin")); }