diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Application.Tests/Volo/Abp/PermissionManagement/PermissionAppService_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Application.Tests/Volo/Abp/PermissionManagement/PermissionAppService_Tests.cs index 8b36b02877..e944aeebc2 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.Application.Tests/Volo/Abp/PermissionManagement/PermissionAppService_Tests.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Application.Tests/Volo/Abp/PermissionManagement/PermissionAppService_Tests.cs @@ -65,7 +65,7 @@ namespace Volo.Abp.PermissionManagement.Application.Tests.Volo.Abp.PermissionMan [Fact] public async Task Update_Revoke_Test() { - _permissionGrantRepository.Insert( + await _permissionGrantRepository.InsertAsync( new PermissionGrant( Guid.NewGuid(), "MyPermission1", diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/AbpPermissionManagementTestBaseModule.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/AbpPermissionManagementTestBaseModule.cs index ec343d9615..20f4c94b62 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/AbpPermissionManagementTestBaseModule.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/AbpPermissionManagementTestBaseModule.cs @@ -2,6 +2,7 @@ using Volo.Abp.Authorization.Permissions; using Volo.Abp.Autofac; using Volo.Abp.Modularity; +using Volo.Abp.Threading; namespace Volo.Abp.PermissionManagement { @@ -29,9 +30,9 @@ namespace Volo.Abp.PermissionManagement { using (var scope = context.ServiceProvider.CreateScope()) { - scope.ServiceProvider + AsyncHelper.RunSync(() => scope.ServiceProvider .GetRequiredService() - .Build(); + .BuildAsync()); } } } diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/PermissionTestDataBuilder.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/PermissionTestDataBuilder.cs index 9d9e2ab10f..662d0b17c8 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/PermissionTestDataBuilder.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.TestBase/Volo/Abp/PermissionManagement/PermissionTestDataBuilder.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using Volo.Abp.Authorization.Permissions; using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; @@ -19,9 +20,9 @@ namespace Volo.Abp.PermissionManagement _permissionGrantRepository = permissionGrantRepository; } - public void Build() + public async Task BuildAsync() { - _permissionGrantRepository.Insert( + await _permissionGrantRepository.InsertAsync( new PermissionGrant( _guidGenerator.Create(), "MyPermission1", @@ -30,7 +31,7 @@ namespace Volo.Abp.PermissionManagement ) ); - _permissionGrantRepository.Insert( + await _permissionGrantRepository.InsertAsync( new PermissionGrant( _guidGenerator.Create(), "MyPermission3", diff --git a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs b/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs index d1e249c29a..aac1272ccd 100644 --- a/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs +++ b/modules/permission-management/test/Volo.Abp.PermissionManagement.Tests/Volo/Abp/PermissionManagement/PermissionManagementProvider_Tests.cs @@ -22,7 +22,7 @@ namespace Volo.Abp.PermissionManagement [Fact] public async Task CheckAsync() { - _permissionGrantRepository.Insert( + await _permissionGrantRepository.InsertAsync( new PermissionGrant( Guid.NewGuid(), "MyPermission1", @@ -54,7 +54,7 @@ namespace Volo.Abp.PermissionManagement [Fact] public async Task SetAsync() { - _permissionGrantRepository.Insert( + await _permissionGrantRepository.InsertAsync( new PermissionGrant( Guid.NewGuid(), "MyPermission1", diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/AbpSettingManagementTestBaseModule.cs b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/AbpSettingManagementTestBaseModule.cs index 7d90dcd747..058bd8ff49 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/AbpSettingManagementTestBaseModule.cs +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/AbpSettingManagementTestBaseModule.cs @@ -2,6 +2,7 @@ using Volo.Abp.Autofac; using Volo.Abp.Modularity; using Volo.Abp.Settings; +using Volo.Abp.Threading; namespace Volo.Abp.SettingManagement { @@ -20,9 +21,9 @@ namespace Volo.Abp.SettingManagement { using (var scope = context.ServiceProvider.CreateScope()) { - scope.ServiceProvider + AsyncHelper.RunSync(()=> scope.ServiceProvider .GetRequiredService() - .Build(); + .BuildAsync()); } } } diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/SettingTestDataBuilder.cs b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/SettingTestDataBuilder.cs index 6843d6257e..a4a0b32a03 100644 --- a/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/SettingTestDataBuilder.cs +++ b/modules/setting-management/test/Volo.Abp.SettingManagement.TestBase/Volo/Abp/SettingManagement/SettingTestDataBuilder.cs @@ -1,4 +1,5 @@ -using Volo.Abp.DependencyInjection; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; using Volo.Abp.Settings; @@ -20,9 +21,9 @@ namespace Volo.Abp.SettingManagement _testData = testData; } - public void Build() + public async Task BuildAsync() { - _settingRepository.Insert( + await _settingRepository.InsertAsync( new Setting( _testData.SettingId, "MySetting1", @@ -31,7 +32,7 @@ namespace Volo.Abp.SettingManagement ) ); - _settingRepository.Insert( + await _settingRepository.InsertAsync( new Setting( _guidGenerator.Create(), "MySetting2", @@ -40,7 +41,7 @@ namespace Volo.Abp.SettingManagement ) ); - _settingRepository.Insert( + await _settingRepository.InsertAsync( new Setting( _guidGenerator.Create(), "MySetting2", @@ -50,7 +51,7 @@ namespace Volo.Abp.SettingManagement ) ); - _settingRepository.Insert( + await _settingRepository.InsertAsync( new Setting( _guidGenerator.Create(), "MySetting2", @@ -60,7 +61,7 @@ namespace Volo.Abp.SettingManagement ) ); - _settingRepository.Insert( + await _settingRepository.InsertAsync( new Setting( _guidGenerator.Create(), "MySettingWithoutInherit", @@ -69,7 +70,7 @@ namespace Volo.Abp.SettingManagement ) ); - _settingRepository.Insert( + await _settingRepository.InsertAsync( new Setting( _guidGenerator.Create(), "MySettingWithoutInherit",