Browse Source
Merge pull request #4209 from abpframework/maliming/identity-patch
Fix identity unit test.
pull/3982/head^2
maliming
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
14 additions and
6 deletions
-
modules/identity/test/Volo.Abp.Identity.TestBase/Volo/Abp/Identity/OrganizationUnitRepository_Tests.cs
|
|
|
@ -167,13 +167,21 @@ namespace Volo.Abp.Identity |
|
|
|
[Fact] |
|
|
|
public async Task RemoveAllRolesOfOrganizationUnit() |
|
|
|
{ |
|
|
|
OrganizationUnit ou = await _organizationUnitRepository.GetAsync("OU111", true); |
|
|
|
var rolesCount = await _organizationUnitRepository.GetRolesCountAsync(ou); |
|
|
|
rolesCount.ShouldBeGreaterThan(1); |
|
|
|
using (var uow = _unitOfWorkManager.Begin()) |
|
|
|
{ |
|
|
|
OrganizationUnit ou = await _organizationUnitRepository.GetAsync("OU111", true); |
|
|
|
var rolesCount = await _organizationUnitRepository.GetRolesCountAsync(ou); |
|
|
|
rolesCount.ShouldBeGreaterThan(1); |
|
|
|
|
|
|
|
await _organizationUnitRepository.RemoveAllRolesAsync(ou); |
|
|
|
var newCount = await _organizationUnitRepository.GetRolesCountAsync(ou); |
|
|
|
newCount.ShouldBe(0); |
|
|
|
await _organizationUnitRepository.RemoveAllRolesAsync(ou); |
|
|
|
|
|
|
|
await uow.SaveChangesAsync(); |
|
|
|
|
|
|
|
var newCount = await _organizationUnitRepository.GetRolesCountAsync(ou); |
|
|
|
newCount.ShouldBe(0); |
|
|
|
|
|
|
|
await uow.CompleteAsync(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|