升级工程:升级组件,更新单元测试

This commit is contained in:
Argo-Surface 2019-01-14 21:48:24 +08:00
parent 96b52478b9
commit 12c53eeead
6 changed files with 18 additions and 13 deletions

View File

@ -14,7 +14,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.0" /> <PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.0" />
<PackageReference Include="Longbow.Logging" Version="2.2.4" /> <PackageReference Include="Longbow.Logging" Version="2.2.5" />
<PackageReference Include="Longbow.Web" Version="2.2.2" /> <PackageReference Include="Longbow.Web" Version="2.2.2" />
<PackageReference Include="Microsoft.AspNetCore.App" /> <PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="2.3.0" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="2.3.0" />

View File

@ -11,9 +11,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="1.1.0" /> <PackageReference Include="Bootstrap.Security.DataAccess" Version="1.1.1" />
<PackageReference Include="Longbow.Cache" Version="2.2.0" /> <PackageReference Include="Longbow.Cache" Version="2.2.2" />
<PackageReference Include="Longbow.Web" Version="2.2.0" /> <PackageReference Include="Longbow.Web" Version="2.2.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -10,9 +10,9 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.0" /> <PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.0" />
<PackageReference Include="Longbow.Cache" Version="2.2.0" /> <PackageReference Include="Longbow.Cache" Version="2.2.2" />
<PackageReference Include="Longbow.Logging" Version="2.2.1" /> <PackageReference Include="Longbow.Logging" Version="2.2.5" />
<PackageReference Include="Longbow.Web" Version="2.2.0" /> <PackageReference Include="Longbow.Web" Version="2.2.2" />
<PackageReference Include="Microsoft.AspNetCore.App" /> <PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup> </ItemGroup>

View File

@ -13,9 +13,9 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="1.1.1" /> <PackageReference Include="Bootstrap.Security.DataAccess" Version="1.1.1" />
<PackageReference Include="Longbow.Data" Version="2.2.2" /> <PackageReference Include="Longbow.Data" Version="2.2.2" />
<PackageReference Include="Longbow.Security.Cryptography" Version="1.2.0" /> <PackageReference Include="Longbow.Security.Cryptography" Version="1.3.0" />
<PackageReference Include="Longbow.Web" Version="2.2.2" /> <PackageReference Include="Longbow.Web" Version="2.2.2" />
<PackageReference Include="Longbow.Cache" Version="2.2.1" /> <PackageReference Include="Longbow.Cache" Version="2.2.2" />
<PackageReference Include="Longbow" Version="2.2.3" /> <PackageReference Include="Longbow" Version="2.2.3" />
<PackageReference Include="PetaPoco.Compiled" Version="1.0.1" /> <PackageReference Include="PetaPoco.Compiled" Version="1.0.1" />
</ItemGroup> </ItemGroup>

View File

@ -1,4 +1,4 @@
#define SQLite //#define SQLite
//#define MySQL //#define MySQL
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;

View File

@ -1,4 +1,5 @@
using Xunit; using System.Linq;
using Xunit;
namespace Bootstrap.DataAccess namespace Bootstrap.DataAccess
{ {
@ -45,9 +46,9 @@ namespace Bootstrap.DataAccess
public void RetrieveRolesByMenuId_Ok() public void RetrieveRolesByMenuId_Ok()
{ {
var menu = new Menu(); var menu = new Menu();
menu.SaveMenusByRoleId("1", new string[] { "1" });
var role = new Role(); 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"); var rs = role.RetrievesByMenuId("1");
Assert.Contains(rs, r => r.Checked == "checked"); Assert.Contains(rs, r => r.Checked == "checked");
} }
@ -63,6 +64,8 @@ namespace Bootstrap.DataAccess
public void RetrieveRolesByGroupId_Ok() public void RetrieveRolesByGroupId_Ok()
{ {
var role = new Role(); 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"); Assert.Contains(role.RetrievesByGroupId("1"), r => r.Checked == "checked");
} }
@ -70,6 +73,8 @@ namespace Bootstrap.DataAccess
public void RetrieveRolesByUserName_Ok() public void RetrieveRolesByUserName_Ok()
{ {
var role = new Role(); 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")); Assert.NotEmpty(role.RetrieveRolesByUserName("Admin"));
} }