public async System.Threading.Tasks.Task SaveFilesToIgnore_EmptyState_ConfigAsync() { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); await UnitTestUtility.LoadPackageAsync(); Initialize(string.Empty); await IgnoreFilesAsync(IgnoreCommand.kSingleFileToIgnore); SettingsHandler.SaveFormatSettings(); if (!File.Exists(kFormatSettingsPath)) { Assert.False(true); } XmlSerializer serializer = new XmlSerializer(); var formatSettingsModel = serializer.DeserializeFromFile <ClangFormatOptions>(kFormatSettingsPath); var filesToIgnore = formatSettingsModel.SkipFiles; var expectedRestul = string.Join(";", IgnoreCommand.kSingleFileToIgnore); SettingsTestUtility.ResetClangFormatOptionsView(); Assert.Equal(filesToIgnore, expectedRestul); }
public async System.Threading.Tasks.Task SaveFilesToIgnore_NoEmptyState_ConfigAsync() { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); await UnitTestUtility.LoadPackageAsync(); var expectedResult = string.Join(";", IgnoreCommand.kStartUpMultipleFilesToIgnore); Initialize(string.Empty); await IgnoreFilesAsync(IgnoreCommand.kStartUpMultipleFilesToIgnore); await IgnoreFilesAsync(IgnoreCommand.kMultipleFilesToIgnore); SettingsHandler.SaveGeneralSettings(); if (!File.Exists(kGeneralSettingsPath)) { Assert.False(true); } XmlSerializer serializer = new XmlSerializer(); var generalSettingsModel = serializer.DeserializeFromFile <ClangOptions>(kGeneralSettingsPath); expectedResult += ";" + string.Join(";", IgnoreCommand.kMultipleFilesToIgnore); var filesToIgnore = generalSettingsModel.FilesToIgnoreCollection; SettingsTestUtility.ResetClangGeneralOptionsView(); Assert.Equal(filesToIgnore, expectedResult); }
private void Initialize(string ignoreFiles) { ThreadHelper.ThrowIfNotOnUIThread(); mDte = (DTE2)ServiceProvider.GlobalProvider.GetService(typeof(DTE)); SettingsTestUtility.ResetClangFormatOptionsView(); mIgnoreFormatCommand = IgnoreFormatCommand.Instance; mFormatOptions = SettingsProvider.ClangFormatSettings; mFormatOptions.FilesToIgnore = ignoreFiles; }
public async System.Threading.Tasks.Task SaveMultipleFilesToIgnore_EmptyState_UIAsync() { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); await UnitTestUtility.LoadPackageAsync(); Initialize(string.Empty); await IgnoreFilesAsync(IgnoreCommand.kMultipleFilesToIgnore); SettingsHandler.SaveFormatSettings(); var filesToIgnore = mFormatOptions.FilesToIgnore; var expectedRestul = string.Join(";", IgnoreCommand.kMultipleFilesToIgnore); SettingsTestUtility.ResetClangFormatOptionsView(); Assert.Equal(filesToIgnore, expectedRestul); }
public async System.Threading.Tasks.Task SaveFilesToIgnore_NoEmptyState_UIAsync() { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); await UnitTestUtility.LoadPackageAsync(); var expectedResult = string.Join(";", IgnoreCommand.kStartUpMultipleFilesToIgnore); Initialize(expectedResult); await IgnoreFilesAsync(IgnoreCommand.kMultipleFilesToIgnore); SettingsHandler.SaveGeneralSettings(); expectedResult += ";" + string.Join(";", IgnoreCommand.kMultipleFilesToIgnore); var filesToIgnore = mGeneralOptions.FilesToIgnore; SettingsTestUtility.ResetClangGeneralOptionsView(); Assert.Equal(filesToIgnore, expectedResult); }