From c6ba7b4bf2f7c949ac548eccbdb4b3156072f56b Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 2 Jan 2024 17:15:42 +0800 Subject: [PATCH] Fix the unit tests. --- .../AbpAuthorizationServiceExtensions_Tests.cs | 10 +++++----- ...lobalFeatureNotEnableException_Localization_Test.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/framework/test/Volo.Abp.Authorization.Tests/Microsoft/AspNetCore/Authorization/AbpAuthorizationServiceExtensions_Tests.cs b/framework/test/Volo.Abp.Authorization.Tests/Microsoft/AspNetCore/Authorization/AbpAuthorizationServiceExtensions_Tests.cs index b6a0195e27..7c9504a586 100644 --- a/framework/test/Volo.Abp.Authorization.Tests/Microsoft/AspNetCore/Authorization/AbpAuthorizationServiceExtensions_Tests.cs +++ b/framework/test/Volo.Abp.Authorization.Tests/Microsoft/AspNetCore/Authorization/AbpAuthorizationServiceExtensions_Tests.cs @@ -22,27 +22,27 @@ public class AbpAuthorizationServiceExtensions_Tests : AuthorizationTestBase { var exception = new AbpAuthorizationException(code: AbpAuthorizationErrorCodes.GivenPolicyHasNotGranted); var errorInfo = _exceptionToErrorInfoConverter.Convert(exception); - errorInfo.Message.ShouldBe("授权失败! 提供的策略尚未授予."); + errorInfo.Message.ShouldBe("授权失败!提供的策略尚未授予。"); exception = new AbpAuthorizationException(code: AbpAuthorizationErrorCodes.GivenPolicyHasNotGrantedWithPolicyName) .WithData("PolicyName", "my_policy_name"); errorInfo = _exceptionToErrorInfoConverter.Convert(exception); - errorInfo.Message.ShouldBe("授权失败! 提供的策略尚未授予: my_policy_name"); + errorInfo.Message.ShouldBe("授权失败!提供的策略尚未授予: my_policy_name"); exception = new AbpAuthorizationException(code: AbpAuthorizationErrorCodes.GivenPolicyHasNotGrantedForGivenResource) .WithData("ResourceName", "my_resource_name"); errorInfo = _exceptionToErrorInfoConverter.Convert(exception); - errorInfo.Message.ShouldBe("授权失败! 提供的策略未授予提供的资源: my_resource_name"); + errorInfo.Message.ShouldBe("授权失败!提供的策略未授予提供的资源:my_resource_name"); exception = new AbpAuthorizationException(code: AbpAuthorizationErrorCodes.GivenRequirementHasNotGrantedForGivenResource) .WithData("ResourceName", "my_resource_name"); errorInfo = _exceptionToErrorInfoConverter.Convert(exception); - errorInfo.Message.ShouldBe("授权失败! 提供的要求未授予提供的资源: my_resource_name"); + errorInfo.Message.ShouldBe("授权失败!提供的要求未授予提供的资源:my_resource_name"); exception = new AbpAuthorizationException(code: AbpAuthorizationErrorCodes.GivenRequirementsHasNotGrantedForGivenResource) .WithData("ResourceName", "my_resource_name"); errorInfo = _exceptionToErrorInfoConverter.Convert(exception); - errorInfo.Message.ShouldBe("授权失败! 提供的要求未授予提供的资源: my_resource_name"); + errorInfo.Message.ShouldBe("授权失败!提供的要求未授予提供的资源:my_resource_name"); } } } diff --git a/framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/AbpGlobalFeatureNotEnableException_Localization_Test.cs b/framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/AbpGlobalFeatureNotEnableException_Localization_Test.cs index 5917bde11d..bc45ada9ad 100644 --- a/framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/AbpGlobalFeatureNotEnableException_Localization_Test.cs +++ b/framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/AbpGlobalFeatureNotEnableException_Localization_Test.cs @@ -23,7 +23,7 @@ public class AbpGlobalFeatureNotEnableException_Localization_Test : GlobalFeatur .WithData("ServiceName", "MyService") .WithData("GlobalFeatureName", "TestFeature"); ; var errorInfo = _exceptionToErrorInfoConverter.Convert(exception); - errorInfo.Message.ShouldBe("'MyService'服务需要启用'TestFeature'功能."); + errorInfo.Message.ShouldBe("'MyService' 服务需要启用 'TestFeature'。"); } } }