Beispiel #1
0
        public async Task SavePresetTest_正常()
        {
            appSettings.AppDataPath = @"C:\AppData";
            settingService.UserSettings.PresetInfos.Add(new PresetInfo()
            {
                Id       = "100",
                Name     = "foo",
                FileName = "foo_100.json",
            });
            settingService.UserSettings.PresetInfos.Add(new PresetInfo()
            {
                Id       = "200",
                Name     = "bar",
                FileName = "bar_200.json",
            });
            settingService.UserSettings.MergeUnknownJsonProperty = true;

            await target.SavePresetAsync("200");

            Assert.IsFalse(target.ConfigJson.IsChanged);

            Assert.IsFalse(target.IsBusy);
            CollectionAssert.AreEqual(new[] { nameof(ConfigJsonService.IsBusy), nameof(ConfigJsonService.IsBusy) }, notifiedProperies);
            Assert.AreEqual(Path.Combine(appSettings.AppDataPath, "bar_200.json"), fileService.WriteAsyncPath);
        }
Beispiel #2
0
        /// <summary>
        /// プリセットの上書き保存
        /// </summary>
        public async void Save()
        {
            if (CurrentPreset == null)
            {
                return;
            }

            await ConfigJsonService.SavePresetAsync(CurrentPreset.Id);
        }