Ejemplo n.º 1
0
        public async void Should_Change_And_Revert()
        {
            var sd = new Dictionary <string, string>
            {
                { "SettingWithProperty", "new-prop" },
                { "SettingWithDefaultValue", "new-default" },
                { "SettingWithoutDefaultValue", "new-no-default" }
            };

            await _appService.UpdateAsync(sd);

            (await _manager.GetOrNullForCurrentTenantAsync("SettingWithProperty"))
            .ShouldBe("new-prop");
            (await _manager.GetOrNullForCurrentTenantAsync("SettingWithDefaultValue"))
            .ShouldBe("new-default");
            (await _manager.GetOrNullForCurrentTenantAsync("SettingWithoutDefaultValue"))
            .ShouldBe("new-no-default");

            await _appService.DeleteAsync(new List <string>
            {
                "SettingWithProperty",
                "SettingWithDefaultValue",
                "SettingWithoutDefaultValue"
            });

            (await _manager.GetOrNullForCurrentTenantAsync("SettingWithProperty"))
            .ShouldBe("default_value_2");
            (await _manager.GetOrNullForCurrentTenantAsync("SettingWithDefaultValue"))
            .ShouldBe("default_value_1");
            (await _manager.GetOrNullForCurrentTenantAsync("SettingWithoutDefaultValue"))
            .ShouldBe("no-default");     // fallback 机制
            (await _manager.GetOrNullForCurrentTenantAsync("SettingWithoutDefaultValue", false))
            .ShouldBeNull();
        }
 public virtual async Task UpdateAsync([NotNull] string providerName, [NotNull] string providerKey, UpdateSettingsDto input)
 {
     await _settingAppService.UpdateAsync(providerName, providerKey, input);
 }
Ejemplo n.º 3
0
 public Task <Dictionary <string, string> > UpdateAsync(Dictionary <string, string> settings)
 {
     return(_settingAppService.UpdateAsync(settings));
 }