From ecde9207642c5a23dc531478be5d774d7a5c361f Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Thu, 13 Dec 2018 15:05:30 +0300 Subject: [PATCH] Improve SettingManager_Tests.Should_Set_And_Get_Encrypted_Values. --- .../Volo/Abp/Settings/SettingManager_Tests.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/framework/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingManager_Tests.cs b/framework/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingManager_Tests.cs index be039451f2..82231b8318 100644 --- a/framework/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingManager_Tests.cs +++ b/framework/test/Volo.Abp.Settings.Tests/Volo/Abp/Settings/SettingManager_Tests.cs @@ -27,21 +27,25 @@ namespace Volo.Abp.Settings .ShouldBe("default-value"); } - [Fact] - public async Task Should_Set_And_Get_Encrypted_Values() + [Theory] + [InlineData(null)] + [InlineData("")] + [InlineData("abc")] + [InlineData("This is a relatively long text... This is a relatively long text... This is a relatively long text... ")] + public async Task Should_Set_And_Get_Encrypted_Values(string plainValue) { (await _settingManager.GetOrNullAsync(TestSettingNames.TestSettingEncrypted)) .ShouldBeNull(); await _settingManager.SetAsync( TestSettingNames.TestSettingEncrypted, - "abc", + plainValue, TestSettingValueProvider.ProviderName, null ); (await _settingManager.GetOrNullAsync(TestSettingNames.TestSettingEncrypted)) - .ShouldBe("abc"); + .ShouldBe(plainValue); } //TODO: Needs more tests with more advanced scenarios.