Пример #1
0
        public void SetDefaultsWorks()
        {
            var viewModel = new AutoCompleteSettingsViewModel(GetNonDefaultConfig(), null);

            var defaultConfig = GetDefaultConfig();

            viewModel.SetToDefaults(defaultConfig);

            Assert.Multiple(() =>
            {
                Assert.AreEqual(defaultConfig.UserSettings.AutoCompleteSettings.IsEnabled, viewModel.IsEnabled);
                Assert.AreEqual(defaultConfig.UserSettings.AutoCompleteSettings.BlockCompletion.CompleteOnTab, viewModel.CompleteBlockOnTab);
                Assert.AreEqual(defaultConfig.UserSettings.AutoCompleteSettings.BlockCompletion.CompleteOnEnter, viewModel.CompleteBlockOnEnter);
                Assert.AreEqual(defaultConfig.UserSettings.AutoCompleteSettings.SmartConcat.IsEnabled, viewModel.EnableSmartConcat);
            });
        }
Пример #2
0
        public void SaveConfigWorks()
        {
            var customConfig = GetNonDefaultConfig();
            var viewModel    = new AutoCompleteSettingsViewModel(customConfig, null);

            var config = GetDefaultConfig();

            viewModel.UpdateConfig(config);

            Assert.Multiple(() =>
            {
                Assert.AreEqual(config.UserSettings.AutoCompleteSettings.IsEnabled, viewModel.IsEnabled);
                Assert.AreEqual(config.UserSettings.AutoCompleteSettings.BlockCompletion.CompleteOnTab, viewModel.CompleteBlockOnTab);
                Assert.AreEqual(config.UserSettings.AutoCompleteSettings.BlockCompletion.CompleteOnEnter, viewModel.CompleteBlockOnEnter);
                Assert.AreEqual(config.UserSettings.AutoCompleteSettings.SmartConcat.IsEnabled, viewModel.EnableSmartConcat);
            });
        }