From 2f7af82fc189962d85e727b65e34f8624a206dcf Mon Sep 17 00:00:00 2001 From: Javier Campos Date: Sun, 29 Dec 2019 17:39:41 +0100 Subject: [PATCH] feat: add ConfigureAwait(false) to all await calls --- .../FeatureManagement/FeatureAppService.cs | 10 +++---- .../FeatureManagementProvider.cs | 6 ++-- .../FeatureManagementStore.cs | 18 ++++++------ .../Abp/FeatureManagement/FeatureManager.cs | 10 +++---- .../FeatureValueCacheItemInvalidator.cs | 2 +- .../EfCoreFeatureValueRepository.cs | 4 +-- .../MongoDB/MongoFeatureValueRepository.cs | 4 +-- .../FeatureManagementModal.cshtml.cs | 4 +-- .../FeatureAppService_Tests.cs | 6 ++-- .../FeatureManagement/FeatureManager_Tests.cs | 24 ++++++++-------- .../FeatureValueCacheItemInvalidator_Tests.cs | 8 +++--- .../FeatureManagementStore_Tests.cs | 22 +++++++-------- .../FeatureManagementTestDataBuilder.cs | 28 +++++++++---------- .../FeatureValueRepository_Tests.cs | 6 ++-- 14 files changed, 76 insertions(+), 76 deletions(-) diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/FeatureAppService.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/FeatureAppService.cs index 097ea7ffa0..2290e79f00 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/FeatureAppService.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Application/Volo/Abp/FeatureManagement/FeatureAppService.cs @@ -34,7 +34,7 @@ namespace Volo.Abp.FeatureManagement public virtual async Task GetAsync([NotNull] string providerName, [NotNull] string providerKey) { - await CheckProviderPolicy(providerName); + await CheckProviderPolicy(providerName).ConfigureAwait(false); var featureDefinitions = _featureDefinitionManager.GetAll(); var features = new List(); @@ -48,7 +48,7 @@ namespace Volo.Abp.FeatureManagement ValueType = featureDefinition.ValueType, Description = featureDefinition.Description?.Localize(_stringLocalizerFactory), ParentName = featureDefinition.Parent?.Name, - Value = await _featureManager.GetOrNullAsync(featureDefinition.Name, providerName, providerKey) + Value = await _featureManager.GetOrNullAsync(featureDefinition.Name, providerName, providerKey).ConfigureAwait(false) }); } @@ -59,11 +59,11 @@ namespace Volo.Abp.FeatureManagement public virtual async Task UpdateAsync([NotNull] string providerName, [NotNull] string providerKey, UpdateFeaturesDto input) { - await CheckProviderPolicy(providerName); + await CheckProviderPolicy(providerName).ConfigureAwait(false); foreach (var feature in input.Features) { - await _featureManager.SetAsync(feature.Name, feature.Value, providerName, providerKey); + await _featureManager.SetAsync(feature.Name, feature.Value, providerName, providerKey).ConfigureAwait(false); } } @@ -88,7 +88,7 @@ namespace Volo.Abp.FeatureManagement throw new AbpException($"No policy defined to get/set permissions for the provider '{policyName}'. Use {nameof(FeatureManagementOptions)} to map the policy."); } - await AuthorizationService.CheckAsync(policyName); + await AuthorizationService.CheckAsync(policyName).ConfigureAwait(false); } } } diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManagementProvider.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManagementProvider.cs index 1d0c59773b..58353321fa 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManagementProvider.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManagementProvider.cs @@ -16,17 +16,17 @@ namespace Volo.Abp.FeatureManagement public async Task GetOrNullAsync(FeatureDefinition feature, string providerKey) { - return await Store.GetOrNullAsync(feature.Name, Name, NormalizeProviderKey(providerKey)); + return await Store.GetOrNullAsync(feature.Name, Name, NormalizeProviderKey(providerKey)).ConfigureAwait(false); } public virtual async Task SetAsync(FeatureDefinition feature, string value, string providerKey) { - await Store.SetAsync(feature.Name, value, Name, NormalizeProviderKey(providerKey)); + await Store.SetAsync(feature.Name, value, Name, NormalizeProviderKey(providerKey)).ConfigureAwait(false); } public virtual async Task ClearAsync(FeatureDefinition feature, string providerKey) { - await Store.DeleteAsync(feature.Name, Name, NormalizeProviderKey(providerKey)); + await Store.DeleteAsync(feature.Name, Name, NormalizeProviderKey(providerKey)).ConfigureAwait(false); } protected virtual string NormalizeProviderKey(string providerKey) diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManagementStore.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManagementStore.cs index 94c4d48067..2970296381 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManagementStore.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManagementStore.cs @@ -23,52 +23,52 @@ namespace Volo.Abp.FeatureManagement public async Task GetOrNullAsync(string name, string providerName, string providerKey) { - var cacheItem = await GetCacheItemAsync(name, providerName, providerKey); + var cacheItem = await GetCacheItemAsync(name, providerName, providerKey).ConfigureAwait(false); return cacheItem.Value; } public async Task SetAsync(string name, string value, string providerName, string providerKey) { - var featureValue = await FeatureValueRepository.FindAsync(name, providerName, providerKey); + var featureValue = await FeatureValueRepository.FindAsync(name, providerName, providerKey).ConfigureAwait(false); if (featureValue == null) { featureValue = new FeatureValue(GuidGenerator.Create(), name, value, providerName, providerKey); - await FeatureValueRepository.InsertAsync(featureValue); + await FeatureValueRepository.InsertAsync(featureValue).ConfigureAwait(false); } else { featureValue.Value = value; - await FeatureValueRepository.UpdateAsync(featureValue); + await FeatureValueRepository.UpdateAsync(featureValue).ConfigureAwait(false); } } public async Task DeleteAsync(string name, string providerName, string providerKey) { - var featureValue = await FeatureValueRepository.FindAsync(name, providerName, providerKey); + var featureValue = await FeatureValueRepository.FindAsync(name, providerName, providerKey).ConfigureAwait(false); if (featureValue != null) { - await FeatureValueRepository.DeleteAsync(featureValue); + await FeatureValueRepository.DeleteAsync(featureValue).ConfigureAwait(false); } } protected virtual async Task GetCacheItemAsync(string name, string providerName, string providerKey) { var cacheKey = CalculateCacheKey(name, providerName, providerKey); - var cacheItem = await Cache.GetAsync(cacheKey); + var cacheItem = await Cache.GetAsync(cacheKey).ConfigureAwait(false); if (cacheItem != null) { return cacheItem; } - var featureValue = await FeatureValueRepository.FindAsync(name, providerName, providerKey); + var featureValue = await FeatureValueRepository.FindAsync(name, providerName, providerKey).ConfigureAwait(false); cacheItem = new FeatureValueCacheItem(featureValue?.Value); await Cache.SetAsync( cacheKey, cacheItem - ); + ).ConfigureAwait(false); return cacheItem; } diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManager.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManager.cs index 06ca345bf6..8249166f20 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManager.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManager.cs @@ -82,7 +82,7 @@ namespace Volo.Abp.FeatureManagement var providerValue = await provider.GetOrNullAsync( feature, provider.Name == providerName ? providerKey : null - ); + ).ConfigureAwait(false); if (providerValue != null) { @@ -123,7 +123,7 @@ namespace Volo.Abp.FeatureManagement if (providers.Count > 1 && !forceToSet && value != null) { - var fallbackValue = await GetOrNullInternalAsync(name, providers[1].Name, null); + var fallbackValue = await GetOrNullInternalAsync(name, providers[1].Name, null).ConfigureAwait(false); if (fallbackValue == value) { //Clear the value if it's same as it's fallback value @@ -139,14 +139,14 @@ namespace Volo.Abp.FeatureManagement { foreach (var provider in providers) { - await provider.ClearAsync(feature, providerKey); + await provider.ClearAsync(feature, providerKey).ConfigureAwait(false); } } else { foreach (var provider in providers) { - await provider.SetAsync(feature, value, providerKey); + await provider.SetAsync(feature, value, providerKey).ConfigureAwait(false); } } } @@ -172,7 +172,7 @@ namespace Volo.Abp.FeatureManagement value = await provider.GetOrNullAsync( feature, provider.Name == providerName ? providerKey : null - ); + ).ConfigureAwait(false); if (value != null) { diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureValueCacheItemInvalidator.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureValueCacheItemInvalidator.cs index 63e207b1e7..1d13d46e0a 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureValueCacheItemInvalidator.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureValueCacheItemInvalidator.cs @@ -25,7 +25,7 @@ namespace Volo.Abp.FeatureManagement eventData.Entity.ProviderKey ); - await Cache.RemoveAsync(cacheKey); + await Cache.RemoveAsync(cacheKey).ConfigureAwait(false); } protected virtual string CalculateCacheKey(string name, string providerName, string providerKey) diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/EfCoreFeatureValueRepository.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/EfCoreFeatureValueRepository.cs index 9545ac36b4..87251ff366 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/EfCoreFeatureValueRepository.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/EfCoreFeatureValueRepository.cs @@ -20,7 +20,7 @@ namespace Volo.Abp.FeatureManagement.EntityFrameworkCore return await DbSet .FirstOrDefaultAsync( s => s.Name == name && s.ProviderName == providerName && s.ProviderKey == providerKey - ); + ).ConfigureAwait(false); } public async Task> GetListAsync(string providerName, string providerKey) @@ -28,7 +28,7 @@ namespace Volo.Abp.FeatureManagement.EntityFrameworkCore return await DbSet .Where( s => s.ProviderName == providerName && s.ProviderKey == providerKey - ).ToListAsync(); + ).ToListAsync().ConfigureAwait(false); } } } \ No newline at end of file diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/MongoFeatureValueRepository.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/MongoFeatureValueRepository.cs index f57d125dce..62e112b764 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/MongoFeatureValueRepository.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/MongoFeatureValueRepository.cs @@ -19,14 +19,14 @@ namespace Volo.Abp.FeatureManagement.MongoDB public async Task FindAsync(string name, string providerName, string providerKey) { return await GetMongoQueryable() - .FirstOrDefaultAsync(s => s.Name == name && s.ProviderName == providerName && s.ProviderKey == providerKey); + .FirstOrDefaultAsync(s => s.Name == name && s.ProviderName == providerName && s.ProviderKey == providerKey).ConfigureAwait(false); } public async Task> GetListAsync(string providerName, string providerKey) { return await GetMongoQueryable() .Where(s => s.ProviderName == providerName && s.ProviderKey == providerKey) - .ToListAsync(); + .ToListAsync().ConfigureAwait(false); } } } \ No newline at end of file diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs index d9e0d7b2c4..4360e0d72c 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml.cs @@ -36,7 +36,7 @@ namespace Volo.Abp.FeatureManagement.Web.Pages.FeatureManagement public async Task OnGetAsync() { - FeatureListDto = await _featureAppService.GetAsync(ProviderName, ProviderKey); + FeatureListDto = await _featureAppService.GetAsync(ProviderName, ProviderKey).ConfigureAwait(false); } public async Task OnPostAsync() @@ -50,7 +50,7 @@ namespace Volo.Abp.FeatureManagement.Web.Pages.FeatureManagement }).ToList() }; - await _featureAppService.UpdateAsync(ProviderName, ProviderKey, features); + await _featureAppService.UpdateAsync(ProviderName, ProviderKey, features).ConfigureAwait(false); return NoContent(); } diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.Application.Tests/Volo/Abp/FeatureManagement/FeatureAppService_Tests.cs b/modules/feature-management/test/Volo.Abp.FeatureManagement.Application.Tests/Volo/Abp/FeatureManagement/FeatureAppService_Tests.cs index b86e6be013..8987a232b0 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.Application.Tests/Volo/Abp/FeatureManagement/FeatureAppService_Tests.cs +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.Application.Tests/Volo/Abp/FeatureManagement/FeatureAppService_Tests.cs @@ -39,7 +39,7 @@ namespace Volo.Abp.FeatureManagement Login(_testData.User1Id); var featureList = await _featureAppService.GetAsync(EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString()); + TestEditionIds.Regular.ToString()).ConfigureAwait(false); featureList.ShouldNotBeNull(); featureList.Features.ShouldContain(feature => feature.Name == TestFeatureDefinitionProvider.SocialLogins); @@ -61,10 +61,10 @@ namespace Volo.Abp.FeatureManagement Value = false.ToString().ToLowerInvariant() } } - }); + }).ConfigureAwait(false); (await _featureAppService.GetAsync(EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString())).Features.Any(x => + TestEditionIds.Regular.ToString()).ConfigureAwait(false)).Features.Any(x => x.Name == TestFeatureDefinitionProvider.SocialLogins && x.Value == false.ToString().ToLowerInvariant()) .ShouldBeTrue(); diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.Domain.Tests/Volo/Abp/FeatureManagement/FeatureManager_Tests.cs b/modules/feature-management/test/Volo.Abp.FeatureManagement.Domain.Tests/Volo/Abp/FeatureManagement/FeatureManager_Tests.cs index bae9041a51..b682a82bcf 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.Domain.Tests/Volo/Abp/FeatureManagement/FeatureManager_Tests.cs +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.Domain.Tests/Volo/Abp/FeatureManagement/FeatureManager_Tests.cs @@ -21,63 +21,63 @@ namespace Volo.Abp.FeatureManagement (await _featureManager.GetOrNullDefaultAsync( TestFeatureDefinitionProvider.SocialLogins - )).ShouldBeNull(); + ).ConfigureAwait(false)).ShouldBeNull(); (await _featureManager.GetOrNullDefaultAsync( TestFeatureDefinitionProvider.DailyAnalysis - )).ShouldBe(false.ToString().ToLowerInvariant()); + ).ConfigureAwait(false)).ShouldBe(false.ToString().ToLowerInvariant()); (await _featureManager.GetOrNullDefaultAsync( TestFeatureDefinitionProvider.ProjectCount - )).ShouldBe("1"); + ).ConfigureAwait(false)).ShouldBe("1"); (await _featureManager.GetOrNullDefaultAsync( TestFeatureDefinitionProvider.BackupCount - )).ShouldBe("0"); + ).ConfigureAwait(false)).ShouldBe("0"); //"Enterprise" edition values (await _featureManager.GetOrNullForEditionAsync( TestFeatureDefinitionProvider.SocialLogins, TestEditionIds.Enterprise - )).ShouldBe(true.ToString().ToLowerInvariant()); + ).ConfigureAwait(false)).ShouldBe(true.ToString().ToLowerInvariant()); (await _featureManager.GetOrNullForEditionAsync( TestFeatureDefinitionProvider.DailyAnalysis, TestEditionIds.Enterprise - )).ShouldBe(false.ToString().ToLowerInvariant()); + ).ConfigureAwait(false)).ShouldBe(false.ToString().ToLowerInvariant()); (await _featureManager.GetOrNullForEditionAsync( TestFeatureDefinitionProvider.ProjectCount, TestEditionIds.Enterprise - )).ShouldBe("3"); + ).ConfigureAwait(false)).ShouldBe("3"); (await _featureManager.GetOrNullForEditionAsync( TestFeatureDefinitionProvider.BackupCount, TestEditionIds.Enterprise - )).ShouldBe("5"); + ).ConfigureAwait(false)).ShouldBe("5"); //"Ultimate" edition values (await _featureManager.GetOrNullForEditionAsync( TestFeatureDefinitionProvider.SocialLogins, TestEditionIds.Ultimate - )).ShouldBe(true.ToString().ToLowerInvariant()); + ).ConfigureAwait(false)).ShouldBe(true.ToString().ToLowerInvariant()); (await _featureManager.GetOrNullForEditionAsync( TestFeatureDefinitionProvider.DailyAnalysis, TestEditionIds.Ultimate - )).ShouldBe(true.ToString().ToLowerInvariant()); + ).ConfigureAwait(false)).ShouldBe(true.ToString().ToLowerInvariant()); (await _featureManager.GetOrNullForEditionAsync( TestFeatureDefinitionProvider.ProjectCount, TestEditionIds.Ultimate - )).ShouldBe("10"); + ).ConfigureAwait(false)).ShouldBe("10"); (await _featureManager.GetOrNullForEditionAsync( TestFeatureDefinitionProvider.BackupCount, TestEditionIds.Ultimate - )).ShouldBe("10"); + ).ConfigureAwait(false)).ShouldBe("10"); } } } diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.Domain.Tests/Volo/Abp/FeatureManagement/FeatureValueCacheItemInvalidator_Tests.cs b/modules/feature-management/test/Volo.Abp.FeatureManagement.Domain.Tests/Volo/Abp/FeatureManagement/FeatureValueCacheItemInvalidator_Tests.cs index ce74094f97..f651ff9697 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.Domain.Tests/Volo/Abp/FeatureManagement/FeatureValueCacheItemInvalidator_Tests.cs +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.Domain.Tests/Volo/Abp/FeatureManagement/FeatureValueCacheItemInvalidator_Tests.cs @@ -28,19 +28,19 @@ namespace Volo.Abp.FeatureManagement // Arrange cache feature. await _featureManagementStore.GetOrNullAsync(TestFeatureDefinitionProvider.SocialLogins, EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString()); + TestEditionIds.Regular.ToString()).ConfigureAwait(false); var feature = await _featureValueRepository.FindAsync(TestFeatureDefinitionProvider.SocialLogins, EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString()); + TestEditionIds.Regular.ToString()).ConfigureAwait(false); // Act - await _featureValueRepository.DeleteAsync(feature); + await _featureValueRepository.DeleteAsync(feature).ConfigureAwait(false); // Assert (await _cache.GetAsync(FeatureValueCacheItem.CalculateCacheKey(TestFeatureDefinitionProvider.SocialLogins, EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString()))).ShouldBeNull(); + TestEditionIds.Regular.ToString())).ConfigureAwait(false)).ShouldBeNull(); } } diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementStore_Tests.cs b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementStore_Tests.cs index a6f040dde3..500e28233c 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementStore_Tests.cs +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementStore_Tests.cs @@ -27,11 +27,11 @@ namespace Volo.Abp.FeatureManagement // Act (await FeatureManagementStore.GetOrNullAsync(Guid.NewGuid().ToString(), EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString())).ShouldBeNull(); + TestEditionIds.Regular.ToString()).ConfigureAwait(false)).ShouldBeNull(); (await FeatureManagementStore.GetOrNullAsync(TestFeatureDefinitionProvider.SocialLogins, EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString())).ShouldNotBeNull(); + TestEditionIds.Regular.ToString()).ConfigureAwait(false)).ShouldNotBeNull(); } [Fact] @@ -40,17 +40,17 @@ namespace Volo.Abp.FeatureManagement // Arrange (await FeatureManagementStore.GetOrNullAsync(TestFeatureDefinitionProvider.SocialLogins, EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString())).ShouldNotBeNull(); + TestEditionIds.Regular.ToString()).ConfigureAwait(false)).ShouldNotBeNull(); // Act await FeatureManagementStore.DeleteAsync(TestFeatureDefinitionProvider.SocialLogins, EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString()); + TestEditionIds.Regular.ToString()).ConfigureAwait(false); // Assert (await FeatureManagementStore.GetOrNullAsync(TestFeatureDefinitionProvider.SocialLogins, EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString())).ShouldBeNull(); + TestEditionIds.Regular.ToString()).ConfigureAwait(false)).ShouldBeNull(); } [Fact] @@ -59,18 +59,18 @@ namespace Volo.Abp.FeatureManagement // Arrange (await FeatureValueRepository.FindAsync(TestFeatureDefinitionProvider.SocialLogins, EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString())).Value.ShouldBe(true.ToString().ToLowerInvariant()); + TestEditionIds.Regular.ToString()).ConfigureAwait(false)).Value.ShouldBe(true.ToString().ToLowerInvariant()); // Act await FeatureManagementStore.SetAsync(TestFeatureDefinitionProvider.SocialLogins, false.ToString().ToUpperInvariant(), EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString()); + TestEditionIds.Regular.ToString()).ConfigureAwait(false); // Assert (await FeatureValueRepository.FindAsync(TestFeatureDefinitionProvider.SocialLogins, EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString())).Value.ShouldBe(false.ToString().ToUpperInvariant()); + TestEditionIds.Regular.ToString()).ConfigureAwait(false)).Value.ShouldBe(false.ToString().ToUpperInvariant()); } [Fact] @@ -79,18 +79,18 @@ namespace Volo.Abp.FeatureManagement // Arrange (await FeatureValueRepository.FindAsync(TestFeatureDefinitionProvider.SocialLogins, EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString())).ShouldNotBeNull(); + TestEditionIds.Regular.ToString()).ConfigureAwait(false)).ShouldNotBeNull(); // Act await FeatureManagementStore.DeleteAsync(TestFeatureDefinitionProvider.SocialLogins, EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString()); + TestEditionIds.Regular.ToString()).ConfigureAwait(false); // Assert (await FeatureValueRepository.FindAsync(TestFeatureDefinitionProvider.SocialLogins, EditionFeatureValueProvider.ProviderName, - TestEditionIds.Regular.ToString())).ShouldBeNull(); + TestEditionIds.Regular.ToString()).ConfigureAwait(false)).ShouldBeNull(); } diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementTestDataBuilder.cs b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementTestDataBuilder.cs index 0629693dbd..dc286e6782 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementTestDataBuilder.cs +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureManagementTestDataBuilder.cs @@ -34,7 +34,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Regular.ToString() ) - ); + ).ConfigureAwait(false); //UserCount await _featureValueRepository.InsertAsync( @@ -45,7 +45,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Regular.ToString() ) - ); + ).ConfigureAwait(false); //ProjectCount await _featureValueRepository.InsertAsync( @@ -56,7 +56,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Regular.ToString() ) - ); + ).ConfigureAwait(false); #endregion @@ -71,7 +71,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Enterprise.ToString() ) - ); + ).ConfigureAwait(false); //EmailSupport await _featureValueRepository.InsertAsync( @@ -82,7 +82,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Enterprise.ToString() ) - ); + ).ConfigureAwait(false); //UserCount await _featureValueRepository.InsertAsync( @@ -93,7 +93,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Enterprise.ToString() ) - ); + ).ConfigureAwait(false); //ProjectCount await _featureValueRepository.InsertAsync( @@ -104,7 +104,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Enterprise.ToString() ) - ); + ).ConfigureAwait(false); //BackupCount await _featureValueRepository.InsertAsync( @@ -115,7 +115,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Enterprise.ToString() ) - ); + ).ConfigureAwait(false); #endregion @@ -130,7 +130,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Ultimate.ToString() ) - ); + ).ConfigureAwait(false); //EmailSupport await _featureValueRepository.InsertAsync( @@ -141,7 +141,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Ultimate.ToString() ) - ); + ).ConfigureAwait(false); //EmailSupport await _featureValueRepository.InsertAsync( @@ -152,7 +152,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Ultimate.ToString() ) - ); + ).ConfigureAwait(false); //UserCount await _featureValueRepository.InsertAsync( @@ -163,7 +163,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Ultimate.ToString() ) - ); + ).ConfigureAwait(false); //ProjectCount await _featureValueRepository.InsertAsync( @@ -174,7 +174,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Ultimate.ToString() ) - ); + ).ConfigureAwait(false); //BackupCount await _featureValueRepository.InsertAsync( @@ -185,7 +185,7 @@ namespace Volo.Abp.FeatureManagement EditionFeatureValueProvider.ProviderName, TestEditionIds.Ultimate.ToString() ) - ); + ).ConfigureAwait(false); #endregion } diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureValueRepository_Tests.cs b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureValueRepository_Tests.cs index c7cbb0d8ae..8c3904ef24 100644 --- a/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureValueRepository_Tests.cs +++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.TestBase/Volo/Abp/FeatureManagement/FeatureValueRepository_Tests.cs @@ -25,7 +25,7 @@ namespace Volo.Abp.FeatureManagement TestFeatureDefinitionProvider.ProjectCount, EditionFeatureValueProvider.ProviderName, TestEditionIds.Enterprise.ToString() - ); + ).ConfigureAwait(false); featureValue.ShouldNotBeNull(); featureValue.Value.ShouldBe("3"); @@ -35,7 +35,7 @@ namespace Volo.Abp.FeatureManagement TestFeatureDefinitionProvider.ProjectCount, EditionFeatureValueProvider.ProviderName, "undefined-edition-id" - ); + ).ConfigureAwait(false); featureValue.ShouldBeNull(); } @@ -46,7 +46,7 @@ namespace Volo.Abp.FeatureManagement var featureValues = await Repository.GetListAsync( EditionFeatureValueProvider.ProviderName, TestEditionIds.Enterprise.ToString() - ); + ).ConfigureAwait(false); featureValues.Count.ShouldBeGreaterThan(0);