diff --git a/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs b/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs index 0126758eb8..b32c830002 100644 --- a/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs +++ b/modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityRoleAppService_Tests.cs @@ -102,12 +102,11 @@ namespace Volo.Abp.Identity var result = await _roleAppService.CreateAsync(input); await _organization.CreateAsync(orgInput); - - await _organization.AddRoleToOrganizationUnitAsync(result.Id,orgInput.Id); - - var orgRolesCount=await _organizationUnitRepository.GetRolesCountAsync(orgInput); + + var role = await _roleRepository.GetAsync(result.Id); + await _organization.AddRoleToOrganizationUnitAsync(role,orgInput); //Assert - orgRolesCount.ShouldBeGreaterThan(0); + orgInput.Roles.Count.ShouldBeGreaterThan(0); } [Fact]