-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved #381: Upgrade to Abp v2.1.1.
- Loading branch information
Showing
23 changed files
with
123 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Threading.Tasks; | ||
using Abp.Domain.Uow; | ||
using Abp.ZeroCore.SampleApp.Core; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace Abp.Zero.Roles | ||
{ | ||
public class RoleStore_Tests : AbpZeroTestBase | ||
{ | ||
private readonly RoleStore _roleStore; | ||
|
||
public RoleStore_Tests() | ||
{ | ||
_roleStore = Resolve<RoleStore>(); | ||
} | ||
|
||
[Fact] | ||
public async Task Should_Get_Role_Claims() | ||
{ | ||
using (var uow = Resolve<IUnitOfWorkManager>().Begin()) | ||
{ | ||
var role = await _roleStore.FindByNameAsync("ADMIN"); | ||
role.ShouldNotBeNull(); | ||
|
||
var claims = await _roleStore.GetClaimsAsync(role); | ||
|
||
claims.ShouldNotBeNull(); | ||
|
||
await uow.CompleteAsync(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ests/Zero/TestOrganizationUnitsBuilder.cs → .../TestData/TestOrganizationUnitsBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Collections.Generic; | ||
using System.Security.Claims; | ||
using Abp.Authorization.Roles; | ||
using Abp.ZeroCore.SampleApp.Core; | ||
using Abp.ZeroCore.SampleApp.EntityFramework; | ||
|
||
namespace Abp.Zero.TestData | ||
{ | ||
public class TestRolesBuilder | ||
{ | ||
private readonly SampleAppDbContext _context; | ||
private readonly int _tenantId; | ||
|
||
public TestRolesBuilder(SampleAppDbContext context, int tenantId) | ||
{ | ||
_context = context; | ||
_tenantId = tenantId; | ||
} | ||
|
||
public void Create() | ||
{ | ||
var role = new Role(_tenantId, "ADMIN", "ADMIN") | ||
{ | ||
Claims = new List<RoleClaim>() | ||
}; | ||
|
||
role.Claims.Add(new RoleClaim(role, new Claim("MyClaim1", "MyClaim1Value"))); | ||
role.Claims.Add(new RoleClaim(role, new Claim("MyClaim2", "MyClaim2Value"))); | ||
|
||
_context.Roles.Add(role); | ||
|
||
_context.SaveChanges(); | ||
} | ||
} | ||
} |
Oops, something went wrong.