From c02fdae537d43da1f33d8c42c2342944e9be8bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=B4=AA=E6=9E=97?= Date: Sun, 6 Sep 2020 16:27:15 +0800 Subject: [PATCH] fixed CreateWithDetails unit test --- .../Volo/Abp/Identity/IdentityRoleAppService_Tests.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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]