Exemplo n.º 1
0
        public async Task ExportJsonAsyncTest_正常()
        {
            settingService.UserSettings.MergeUnknownJsonProperty = true;
            var path = @"C:\work\config.json";

            await target.ExportJsonAsync(path);

            CollectionAssert.AreEqual(new[] { nameof(ConfigJsonService.IsBusy), nameof(ConfigJsonService.IsBusy) }, notifiedProperies);
            Assert.IsFalse(target.IsBusy);
            Assert.AreEqual(path, fileService.WriteAsyncPath);
            Assert.AreEqual(fileService.ConfigJson, target.ConfigJson);
            Assert.IsNull(errorEvent);
        }
Exemplo n.º 2
0
        /// <summary>
        /// JSONファイルのエクスポート
        /// </summary>
        private async void ExportJson()
        {
            var message = new SavingFileSelectionMessage("ExportJsonFileDialog")
            {
                Title    = Resources.ExportJsonFileDialogTitle,
                Filter   = Resources.FileDialogJsonFilter,
                FileName = "config.json",
            };

            var result = Messenger.GetResponse(message);

            var path = result?.Response?.FirstOrDefault();

            if (!string.IsNullOrWhiteSpace(path))
            {
                await ConfigJsonService.ExportJsonAsync(path);
            }
        }