From cdaa07d50d4cf10a4408b33c628a89d9f3589448 Mon Sep 17 00:00:00 2001 From: Timo Weike Date: Sun, 7 Feb 2021 18:43:03 +0100 Subject: [PATCH 01/15] Feature: Cleanup - Only for some files Introduces a new option to add a list of regular expressions that determine which files should be included for clean up. Fixes #773 --- .../Cleaning/CodeCleanupAvailabilityLogic.cs | 42 +++++++++++++++++++ CodeMaid/Properties/Resources.Designer.cs | 9 ++++ CodeMaid/Properties/Resources.en-US.resx | 3 ++ CodeMaid/Properties/Resources.resx | 3 ++ CodeMaid/Properties/Settings.Designer.cs | 12 ++++++ CodeMaid/Properties/Settings.settings | 3 ++ .../CleaningFileTypesDataTemplate.xaml | 9 ++++ .../Cleaning/CleaningFileTypesViewModel.cs | 7 ++++ CodeMaid/app.config | 3 ++ 9 files changed, 91 insertions(+) diff --git a/CodeMaid/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs b/CodeMaid/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs index ecca71644..4f9f4b54c 100644 --- a/CodeMaid/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs +++ b/CodeMaid/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs @@ -29,6 +29,14 @@ internal class CodeCleanupAvailabilityLogic .Where(y => !string.IsNullOrEmpty(y)) .ToList()); + private readonly CachedSettingSet _cleanupInclusions = + new CachedSettingSet(() => Settings.Default.Cleaning_InclusionExpression, + expression => + expression.Split(new[] { "||" }, StringSplitOptions.RemoveEmptyEntries) + .Select(x => x.Trim().ToLower()) + .Where(y => !string.IsNullOrEmpty(y)) + .ToList()); + private EditorFactory _editorFactory; #endregion Fields @@ -68,6 +76,11 @@ private CodeCleanupAvailabilityLogic(CodeMaidPackage package) /// private IEnumerable CleanupExclusions => _cleanupExclusions.Value; + /// + /// Gets a set of cleanup inclusion filters. + /// + private IEnumerable CleanupInclusions => _cleanupInclusions.Value; + /// /// A default editor factory, used for its knowledge of language service-extension mappings. /// @@ -115,6 +128,12 @@ internal bool CanCleanupDocument(Document document, bool allowUserPrompts = fals return false; } + if (!IsFileNameIncludedByOptions(document.FullName)) + { + OutputWindowHelper.DiagnosticWriteLine($"CodeCleanupAvailabilityLogic.CanCleanupDocument returned false for '{document.FullName}' due to the file name not being included within CodeMaid Options."); + return false; + } + if (IsParentCodeGeneratorExcludedByOptions(document)) { OutputWindowHelper.DiagnosticWriteLine($"CodeCleanupAvailabilityLogic.CanCleanupDocument returned false for '{document.FullName}' due to a parent code generator."); @@ -326,6 +345,29 @@ private bool IsFileNameExcludedByOptions(string filename) return cleanupExclusions.Any(cleanupExclusion => Regex.IsMatch(filename, cleanupExclusion, RegexOptions.IgnoreCase)); } + /// + /// Determines whether the specified filename is included by options. + /// + /// The filename. + /// True if the filename is included, otherwise false. + private bool IsFileNameIncludedByOptions(string filename) + { + if (string.IsNullOrEmpty(filename)) + { + return false; + } + + var cleanupInclusions = CleanupInclusions; + if (cleanupInclusions == null || !cleanupInclusions.Any()) + { + return true; + } + else + { + return cleanupInclusions.Any(cleanupInclusion => Regex.IsMatch(filename, cleanupInclusion, RegexOptions.IgnoreCase)); + } + } + /// /// Determines whether the specified document has a parent item that is a code generator /// which is excluded by options. diff --git a/CodeMaid/Properties/Resources.Designer.cs b/CodeMaid/Properties/Resources.Designer.cs index bd352aa9f..8307968fa 100644 --- a/CodeMaid/Properties/Resources.Designer.cs +++ b/CodeMaid/Properties/Resources.Designer.cs @@ -1699,6 +1699,15 @@ public class Resources { } } + /// + /// Looks up a localized string similar to Regular expressions that match path names to include or leave empty to include all files (ex: \.resx$ or \\lib\\ ). + /// + public static string RegularExpressionsThatMatchPathNamesToIncludeExResxOrLib { + get { + return ResourceManager.GetString("RegularExpressionsThatMatchPathNamesToIncludeExResxOrLib", resourceCulture); + } + } + /// /// Looks up a localized string similar to Remove. /// diff --git a/CodeMaid/Properties/Resources.en-US.resx b/CodeMaid/Properties/Resources.en-US.resx index b16740e2d..0d645befb 100644 --- a/CodeMaid/Properties/Resources.en-US.resx +++ b/CodeMaid/Properties/Resources.en-US.resx @@ -924,4 +924,7 @@ You have pending changes. Do you want to save them before continuing? + + Regular expressions that match path names to include or leave empty to include all files (ex: \.resx$ or \\lib\\ ) + \ No newline at end of file diff --git a/CodeMaid/Properties/Resources.resx b/CodeMaid/Properties/Resources.resx index b842ce6d5..4b30a7d0f 100644 --- a/CodeMaid/Properties/Resources.resx +++ b/CodeMaid/Properties/Resources.resx @@ -924,4 +924,7 @@ You have pending changes. Do you want to save them before continuing? + + Regular expressions that match path names to include or leave empty to include all files (ex: \.resx$ or \\lib\\ ) + \ No newline at end of file diff --git a/CodeMaid/Properties/Settings.Designer.cs b/CodeMaid/Properties/Settings.Designer.cs index d6ba7fecc..e6eba1674 100644 --- a/CodeMaid/Properties/Settings.Designer.cs +++ b/CodeMaid/Properties/Settings.Designer.cs @@ -2258,5 +2258,17 @@ public sealed partial class Settings : global::System.Configuration.ApplicationS this["Cleaning_InsertBlankLinePaddingAfterFieldsSingleLine"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string Cleaning_InclusionExpression { + get { + return ((string)(this["Cleaning_InclusionExpression"])); + } + set { + this["Cleaning_InclusionExpression"] = value; + } + } } } diff --git a/CodeMaid/Properties/Settings.settings b/CodeMaid/Properties/Settings.settings index fcc61368d..d5337c0af 100644 --- a/CodeMaid/Properties/Settings.settings +++ b/CodeMaid/Properties/Settings.settings @@ -564,5 +564,8 @@ False + + + \ No newline at end of file diff --git a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningFileTypesDataTemplate.xaml b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningFileTypesDataTemplate.xaml index b7ed4a8c8..e3b6ab440 100644 --- a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningFileTypesDataTemplate.xaml +++ b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningFileTypesDataTemplate.xaml @@ -62,6 +62,15 @@ + + + + + + + + \ No newline at end of file diff --git a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningFileTypesViewModel.cs b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningFileTypesViewModel.cs index a704a7847..b2184bec2 100644 --- a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningFileTypesViewModel.cs +++ b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningFileTypesViewModel.cs @@ -21,6 +21,7 @@ public CleaningFileTypesViewModel(CodeMaidPackage package, Settings activeSettin { new SettingToOptionMapping(x => ActiveSettings.Cleaning_ExcludeT4GeneratedCode, x => ExcludeT4GeneratedCode), new SettingToOptionMapping(x => ActiveSettings.Cleaning_ExclusionExpression, x => ExclusionExpression), + new SettingToOptionMapping(x => ActiveSettings.Cleaning_InclusionExpression, x => InclusionExpression), new SettingToOptionMapping(x => ActiveSettings.Cleaning_IncludeCPlusPlus, x => IncludeCPlusPlus), new SettingToOptionMapping(x => ActiveSettings.Cleaning_IncludeCSharp, x => IncludeCSharp), new SettingToOptionMapping(x => ActiveSettings.Cleaning_IncludeCSS, x => IncludeCSS), @@ -225,6 +226,12 @@ public bool IncludeXML set { SetPropertyValue(value); } } + public string InclusionExpression + { + get { return GetPropertyValue(); } + set { SetPropertyValue(value); } + } + #endregion Options } } \ No newline at end of file diff --git a/CodeMaid/app.config b/CodeMaid/app.config index d570f1606..dc6f03e9a 100644 --- a/CodeMaid/app.config +++ b/CodeMaid/app.config @@ -570,6 +570,9 @@ False + + + From 253fa4cb31bdfd1d91651db759e9af70df6b5ea7 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Wed, 3 Mar 2021 08:44:06 -0500 Subject: [PATCH 02/15] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5567791ec..b709b292a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ These changes have not been released to the Visual Studio marketplace, but (if checked) are available in preview within the [CI build](http://vsixgallery.com/extension/4c82e17d-927e-42d2-8460-b473ac7df316/). - [ ] Features + - [x] [#778](https://github.com/codecadwallader/codemaid/pull/778) - Cleaning: Option to specify file inclusions by RegEx - thanks [Timo-Weike](https://github.com/Timo-Weike)! - [ ] Fixes From 546bfb19ac1a708d043de2f9019a224b82447ef6 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Thu, 8 Apr 2021 08:11:04 -0400 Subject: [PATCH 03/15] Fix literal newline characters in dialog Resolves #799 --- CHANGELOG.md | 1 + .../Reorganizing/CodeReorganizationAvailabilityLogic.cs | 2 +- CodeMaid/Properties/Resources.Designer.cs | 8 +++++--- CodeMaid/Properties/Resources.en-US.resx | 6 ++++-- CodeMaid/Properties/Resources.resx | 6 ++++-- CodeMaid/Properties/Resources.zh-Hans.resx | 4 ++-- 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b709b292a..6c881b6fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ These changes have not been released to the Visual Studio marketplace, but (if c - [x] [#778](https://github.com/codecadwallader/codemaid/pull/778) - Cleaning: Option to specify file inclusions by RegEx - thanks [Timo-Weike](https://github.com/Timo-Weike)! - [ ] Fixes + - [x] [] - Reorganizing: Fix dialog showing literal newline characters ## Previous Releases diff --git a/CodeMaid/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs b/CodeMaid/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs index d8cf7c1e3..7cb53f57b 100644 --- a/CodeMaid/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs +++ b/CodeMaid/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs @@ -169,7 +169,7 @@ private static bool PromptUserAboutReorganizingPreprocessorConditionals(Document var viewModel = new YesNoPromptViewModel { Title = @Resources.CodeMaidReorganizePreprocessorConditionals, - Message = string.Format(Resources.ContainsPreprocessorConditionalsEGIfPragmaWhichReorganizationDoesNotCurrentlySupportRNRNDoYouWantToReorganizeAnywaysDANGEROUS, document.Name), + Message = string.Format(Resources.ContainsPreprocessorConditionalsEGIfPragmaWhichReorganizationDoesNotCurrentlySupportDoYouWantToReorganizeAnywaysDANGEROUS, document.Name), CanRemember = true }; diff --git a/CodeMaid/Properties/Resources.Designer.cs b/CodeMaid/Properties/Resources.Designer.cs index 8307968fa..00ec0636a 100644 --- a/CodeMaid/Properties/Resources.Designer.cs +++ b/CodeMaid/Properties/Resources.Designer.cs @@ -925,12 +925,14 @@ public class Resources { } /// - /// Looks up a localized string similar to {0} contains preprocessor conditionals (e.g. #if, #pragma) which reorganization does not currently support.\r\n\r\nDo you want to reorganize anyways (DANGEROUS)?. + /// Looks up a localized string similar to {0} contains preprocessor conditionals (e.g. #if, #pragma) which reorganization does not currently support. + /// + ///Do you want to reorganize anyways (DANGEROUS)?. /// - public static string ContainsPreprocessorConditionalsEGIfPragmaWhichReorganizationDoesNotCurrentlySupportRNRNDoYouWantToReorganizeAnywaysDANGEROUS { + public static string ContainsPreprocessorConditionalsEGIfPragmaWhichReorganizationDoesNotCurrentlySupportDoYouWantToReorganizeAnywaysDANGEROUS { get { return ResourceManager.GetString("ContainsPreprocessorConditionalsEGIfPragmaWhichReorganizationDoesNotCurrentlySupp" + - "ortRNRNDoYouWantToReorganizeAnywaysDANGEROUS", resourceCulture); + "ortDoYouWantToReorganizeAnywaysDANGEROUS", resourceCulture); } } diff --git a/CodeMaid/Properties/Resources.en-US.resx b/CodeMaid/Properties/Resources.en-US.resx index 0d645befb..478d2d37e 100644 --- a/CodeMaid/Properties/Resources.en-US.resx +++ b/CodeMaid/Properties/Resources.en-US.resx @@ -405,8 +405,10 @@ Config files (*.config)|*.config|All Files (*.*)|*.* - - {0} contains preprocessor conditionals (e.g. #if, #pragma) which reorganization does not currently support.\r\n\r\nDo you want to reorganize anyways (DANGEROUS)? + + {0} contains preprocessor conditionals (e.g. #if, #pragma) which reorganization does not currently support. + +Do you want to reorganize anyways (DANGEROUS)? dark diff --git a/CodeMaid/Properties/Resources.resx b/CodeMaid/Properties/Resources.resx index 4b30a7d0f..e80321d63 100644 --- a/CodeMaid/Properties/Resources.resx +++ b/CodeMaid/Properties/Resources.resx @@ -405,8 +405,10 @@ Config files (*.config)|*.config|All Files (*.*)|*.* - - {0} contains preprocessor conditionals (e.g. #if, #pragma) which reorganization does not currently support.\r\n\r\nDo you want to reorganize anyways (DANGEROUS)? + + {0} contains preprocessor conditionals (e.g. #if, #pragma) which reorganization does not currently support. + +Do you want to reorganize anyways (DANGEROUS)? dark diff --git a/CodeMaid/Properties/Resources.zh-Hans.resx b/CodeMaid/Properties/Resources.zh-Hans.resx index 02593c30f..a603889ac 100644 --- a/CodeMaid/Properties/Resources.zh-Hans.resx +++ b/CodeMaid/Properties/Resources.zh-Hans.resx @@ -405,8 +405,8 @@ 配置文件 (*.config)|*.config|所有文件 (*.*)|*.* - - {0} 包含当前整理不支持的预处理器条件 (例如 #if、#pragma)。 \n 是否仍要整理 (危险)? + + {0} 包含当前整理不支持的预处理器条件 (例如 #if、#pragma)。 是否仍要整理 (危险)? 深色 From 4ac6f805579acd280b5604cc10a22aaff27e2d82 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Thu, 8 Apr 2021 08:14:05 -0400 Subject: [PATCH 04/15] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c881b6fc..da18d80ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ These changes have not been released to the Visual Studio marketplace, but (if c - [x] [#778](https://github.com/codecadwallader/codemaid/pull/778) - Cleaning: Option to specify file inclusions by RegEx - thanks [Timo-Weike](https://github.com/Timo-Weike)! - [ ] Fixes - - [x] [] - Reorganizing: Fix dialog showing literal newline characters + - [x] [#800](https://github.com/codecadwallader/codemaid/pull/800) - Reorganizing: Fix dialog showing literal newline characters ## Previous Releases From 407f726549bf1da4ae053965fa67c4e498654843 Mon Sep 17 00:00:00 2001 From: lflender Date: Fri, 7 May 2021 14:05:13 +0200 Subject: [PATCH 05/15] File header update now replaces the file header if one is already present (#797) * File header update now replaces the file header if one is already present Fixing issues #790 #757 * Adding option to choose between Insert or Replace file header * Addressing PR comments Co-authored-by: lflender --- CodeMaid.UnitTests/CodeMaid.UnitTests.csproj | 8 + .../Helpers/FileHeaderHelperTests.cs | 147 ++++++++++++++++ CodeMaid.UnitTests/packages.config | 2 + CodeMaid/CodeMaid.csproj | 2 + CodeMaid/Helpers/CodeLanguage.cs | 2 +- CodeMaid/Helpers/FileHeaderHelper.cs | 162 ++++++++++++++++++ CodeMaid/Logic/Cleaning/FileHeaderLogic.cs | 65 ++++--- CodeMaid/Properties/Settings.Designer.cs | 14 +- CodeMaid/Properties/Settings.settings | 3 + .../Cleaning/CleaningUpdateDataTemplate.xaml | 14 +- .../Cleaning/CleaningUpdateViewModel.cs | 11 ++ CodeMaid/UI/Enumerations/HeaderUpdateMode.cs | 8 + CodeMaid/app.config | 3 + 13 files changed, 413 insertions(+), 28 deletions(-) create mode 100644 CodeMaid.UnitTests/Helpers/FileHeaderHelperTests.cs create mode 100644 CodeMaid/Helpers/FileHeaderHelper.cs create mode 100644 CodeMaid/UI/Enumerations/HeaderUpdateMode.cs diff --git a/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj b/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj index 14ee762ea..d418d35eb 100644 --- a/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj +++ b/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj @@ -1,5 +1,7 @@  + + Debug AnyCPU @@ -68,6 +70,9 @@ ..\packages\NSubstitute.1.10.0.0\lib\net45\NSubstitute.dll True + + ..\packages\NUnit.3.13.1\lib\net45\nunit.framework.dll + @@ -87,6 +92,7 @@ + @@ -134,6 +140,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + \r\n")] + [TestCase(CodeLanguage.HTML, "")] + [TestCase(CodeLanguage.XAML, "\r\n")] + [TestCase(CodeLanguage.XAML, "")] + [TestCase(CodeLanguage.XML, "\r\n")] + [TestCase(CodeLanguage.XML, "")] + [TestCase(CodeLanguage.CSS, "/* some CSS test header */\r\n")] + [TestCase(CodeLanguage.CSS, "/* some CSS \r\ntest \r\nheader */\r\n")] + [TestCase(CodeLanguage.CPlusPlus, "// some CPlusPlus test header\r\n")] + [TestCase(CodeLanguage.CPlusPlus, "/* some C++ \r\ntest\r\n header */\r\n")] + [TestCase(CodeLanguage.PHP, "// some PHP test header\r\n")] + [TestCase(CodeLanguage.PHP, "# some PHP test header\r\n")] + [TestCase(CodeLanguage.PHP, "/* some PHP \r\n test\r\nheader */")] + [TestCase(CodeLanguage.PowerShell, "# some PowerShell test header\r\n")] + [TestCase(CodeLanguage.PowerShell, "<# some PowerShell\r\ntest\r\n header ! #>")] + [TestCase(CodeLanguage.R, "# some R test header\r\n")] + [TestCase(CodeLanguage.FSharp, "// some F# test header\r\n")] + [TestCase(CodeLanguage.FSharp, "(* some F#\r\n test \r\nheader\r\n*)")] + [TestCase(CodeLanguage.VisualBasic, "' some PowerShell test header\r\n")] + public void GetHeaderLengthLanguage(CodeLanguage language, string docStart) + { + var headerLength = FileHeaderHelper.GetHeaderLength(language, docStart); + + Assert.IsTrue(headerLength > 0); + } + + [TestCase(CodeLanguage.CSharp, "# some CSharp test header\r\n")] + [TestCase(CodeLanguage.JavaScript, "\r\n")] + [TestCase(CodeLanguage.LESS, "' some LESS test header\r\n")] + [TestCase(CodeLanguage.SCSS, "# some SCSS test header\r\n")] + [TestCase(CodeLanguage.TypeScript, "\r\n")] + [TestCase(CodeLanguage.HTML, "// some HTML test header\r\n")] + [TestCase(CodeLanguage.XAML, "/* some XAML test header */\r\n")] + [TestCase(CodeLanguage.XML, "' some XML test header\r\n")] + [TestCase(CodeLanguage.CSS, "// some CSS test header\r\n")] + [TestCase(CodeLanguage.CPlusPlus, "# some CPlusPlus test header\r\n")] + [TestCase(CodeLanguage.PHP, "' some PHP test header\r\n")] + [TestCase(CodeLanguage.PowerShell, "/* some PowerShell\r\ntest\r\n header ! */")] + [TestCase(CodeLanguage.R, "// some R test header\r\n")] + [TestCase(CodeLanguage.FSharp, "/* some F#\r\n test \r\nheader\r\n*/")] + [TestCase(CodeLanguage.VisualBasic, "// some PowerShell test header\r\n")] + public void GetHeaderLengthLanguageWithWrongTags(CodeLanguage language, string docStart) + { + var headerLength = FileHeaderHelper.GetHeaderLength(language, docStart); + + Assert.IsTrue(headerLength == 0); + } + + [TestCase("/* */", "/*", "*/")] + [TestCase("/* \r\n Copyright © 2021 \r\n */", "/*", "*/")] + [TestCase("", "")] + [TestCase("", "")] + [TestCase("<# #>", "<#", "#>")] + [TestCase("<# //////////////// \r\n Copyright © 2021 \r\n //////////////// #>", "<#", "#>")] + [TestCase("(* *)", "(*", "*)")] + [TestCase("(* ~~~~ \r\n ~~ \r\n Copyright © 2021 \r\n ~~ \r\n ~~~~ *)", "(*", "*)")] + public void GetHeaderLengthMultiLine(string docStart, string tagStart, string beaconEnd) + { + var headerLength = FileHeaderHelper.GetHeaderLength(docStart, tagStart, beaconEnd); + var length = docStart.Length - Regex.Matches(docStart, Environment.NewLine).Count; + + Assert.IsTrue(headerLength == length); + } + + [TestCase("\r\n/* */", "/*", "*/")] + [TestCase("\r\n\r\n\r\n/* Copyright © 2021 */", "/*", "*/")] + [TestCase("\r\n\r\n", "")] + public void GetHeaderLengthMultiLineWithEmptyLines(string docStart, string tagStart, string tagEnd) + { + var headerLength = FileHeaderHelper.GetHeaderLength(docStart, tagStart, tagEnd); + var value = docStart.Length - Regex.Matches(docStart, Environment.NewLine).Count; + + Assert.IsTrue(headerLength == value); + } + + [TestCase("", "/*", "*/")] + [TestCase("some text", "/*", "*/")] + [TestCase("/* \r\n \r\n ", "/*", "*/")] + [TestCase("/* header */", "/*", "*>")] + [TestCase("*/ ", "/*", "*/")] + public void GetHeaderLengthMultiLineZero(string docStart, string tagStart, string tagEnd) + { + var headerLength = FileHeaderHelper.GetHeaderLength(docStart, tagStart, tagEnd); + + Assert.IsTrue(headerLength == 0); + } + + [TestCase("//", "// header fdsfndksjnfe\r\n")] + [TestCase("#", "# header eropf opekfropze jaqozerijfg uihgsdfidnffdsfg\r\n")] + [TestCase("'", "'header sdvq qsudg bqudgybuydzeau _(àç_ç*ù$^$*ùàyguozadgzao\r\n")] + [TestCase("//", "// ====================\r\n// Copyright\r\n// ====================\r\n")] + [TestCase("#", "# ==============\r\n# Copyright !\r\n# ~~\r\n# ==============\r\n")] + [TestCase("'", "' ==============\r\n' some text\r\n' Copyright !\r\n' ==============\r\n")] + public void GetHeaderLengthMultiSingleLine(string tag, string docStart) + { + var headerLength = FileHeaderHelper.GetHeaderLength(docStart, tag); + var length = docStart.Length - Regex.Matches(docStart, Environment.NewLine).Count; + + Assert.IsTrue(headerLength == length); + } + + [TestCase("//", "// header \r\nnamespace\r\npublic class Test\r\n", 12)] + [TestCase("//", "// header \r\n// more header \r\n some code\r\n", 28)] + [TestCase("#", "# some header\r\nnamespace\r\npublic class Test\r\n", 14)] + [TestCase("'", "' some header\r\nnamespace\r\npublic class Test\r\n", 14)] + public void GetHeaderLengthMultiSingleLineWithCode(string tag, string docStart, int expectedLength) + { + var headerLength = FileHeaderHelper.GetHeaderLength(docStart, tag); + + Assert.IsTrue(headerLength == expectedLength); + } + + [TestCase("//", "\r\n// header \r\n// header\r\nnamespace\r\n//not header\r\n public class Test\r\n", 23)] + [TestCase("//", "\r\n\r\n\r\n// header \r\n// more header \r\n some code\r\n", 31)] + [TestCase("#", "\r\n# some header\r\nnamespace\r\npublic class Test\r\n", 15)] + [TestCase("'", "\r\n' some header\r\nnamespace\r\npublic class Test\r\n", 15)] + public void GetHeaderLengthMultiSingleLineWithEmptyLines(string tag, string docStart, int expectedLength) + { + var headerLength = FileHeaderHelper.GetHeaderLength(docStart, tag); + + Assert.IsTrue(headerLength == expectedLength); + } + } +} \ No newline at end of file diff --git a/CodeMaid.UnitTests/packages.config b/CodeMaid.UnitTests/packages.config index 322163b24..501c6ad39 100644 --- a/CodeMaid.UnitTests/packages.config +++ b/CodeMaid.UnitTests/packages.config @@ -4,5 +4,7 @@ + + \ No newline at end of file diff --git a/CodeMaid/CodeMaid.csproj b/CodeMaid/CodeMaid.csproj index 7d8a3a86c..8b5b27712 100644 --- a/CodeMaid/CodeMaid.csproj +++ b/CodeMaid/CodeMaid.csproj @@ -213,6 +213,7 @@ + @@ -420,6 +421,7 @@ EditableTextBlock.xaml + diff --git a/CodeMaid/Helpers/CodeLanguage.cs b/CodeMaid/Helpers/CodeLanguage.cs index 282053c5b..4a8096f12 100644 --- a/CodeMaid/Helpers/CodeLanguage.cs +++ b/CodeMaid/Helpers/CodeLanguage.cs @@ -7,7 +7,7 @@ /// This is used to encapsulate Visual Studio reported differences we do not want to consider /// (e.g. JavaScript vs. JScript or HTML vs. HTMLX) /// - internal enum CodeLanguage + public enum CodeLanguage { Unknown, CPlusPlus, diff --git a/CodeMaid/Helpers/FileHeaderHelper.cs b/CodeMaid/Helpers/FileHeaderHelper.cs new file mode 100644 index 000000000..3db72a560 --- /dev/null +++ b/CodeMaid/Helpers/FileHeaderHelper.cs @@ -0,0 +1,162 @@ +using EnvDTE; +using SteveCadwallader.CodeMaid.Properties; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; + +namespace SteveCadwallader.CodeMaid.Helpers +{ + internal static class FileHeaderHelper + { + /// + /// Gets the file header from settings based on the language of the specified document. + /// + /// The text document. + /// A file header from settings. + internal static string GetFileHeaderFromSettings(TextDocument textDocument) + { + switch (textDocument.GetCodeLanguage()) + { + case CodeLanguage.CPlusPlus: return Settings.Default.Cleaning_UpdateFileHeaderCPlusPlus; + case CodeLanguage.CSharp: return Settings.Default.Cleaning_UpdateFileHeaderCSharp; + case CodeLanguage.CSS: return Settings.Default.Cleaning_UpdateFileHeaderCSS; + case CodeLanguage.FSharp: return Settings.Default.Cleaning_UpdateFileHeaderFSharp; + case CodeLanguage.HTML: return Settings.Default.Cleaning_UpdateFileHeaderHTML; + case CodeLanguage.JavaScript: return Settings.Default.Cleaning_UpdateFileHeaderJavaScript; + case CodeLanguage.JSON: return Settings.Default.Cleaning_UpdateFileHeaderJSON; + case CodeLanguage.LESS: return Settings.Default.Cleaning_UpdateFileHeaderLESS; + case CodeLanguage.PHP: return Settings.Default.Cleaning_UpdateFileHeaderPHP; + case CodeLanguage.PowerShell: return Settings.Default.Cleaning_UpdateFileHeaderPowerShell; + case CodeLanguage.R: return Settings.Default.Cleaning_UpdateFileHeaderR; + case CodeLanguage.SCSS: return Settings.Default.Cleaning_UpdateFileHeaderSCSS; + case CodeLanguage.TypeScript: return Settings.Default.Cleaning_UpdateFileHeaderTypeScript; + case CodeLanguage.VisualBasic: return Settings.Default.Cleaning_UpdateFileHeaderVB; + case CodeLanguage.XAML: return Settings.Default.Cleaning_UpdateFileHeaderXAML; + case CodeLanguage.XML: return Settings.Default.Cleaning_UpdateFileHeaderXML; + default: return null; + } + } + + internal static int GetHeaderLength(CodeLanguage language, string docStart) + { + switch (language) + { + case CodeLanguage.CSharp: + case CodeLanguage.CPlusPlus: + case CodeLanguage.JavaScript: + case CodeLanguage.LESS: + case CodeLanguage.SCSS: + case CodeLanguage.TypeScript: + return GetHeaderLength(docStart, "//") + + GetHeaderLength(docStart, "/*", "*/"); + + case CodeLanguage.HTML: + case CodeLanguage.XAML: + case CodeLanguage.XML: + return GetHeaderLength(docStart, ""); + + case CodeLanguage.CSS: + return GetHeaderLength(docStart, "/*", "*/"); + + case CodeLanguage.PHP: + return GetHeaderLength(docStart, "//") + + GetHeaderLength(docStart, "#") + + GetHeaderLength(docStart, "/*", "*/"); + + case CodeLanguage.PowerShell: + return GetHeaderLength(docStart, "#") + + GetHeaderLength(docStart, "<#", "#>"); + + case CodeLanguage.R: + return GetHeaderLength(docStart, "#"); + + case CodeLanguage.FSharp: + return GetHeaderLength(docStart, "//") + + GetHeaderLength(docStart, "(*", "*)"); + + case CodeLanguage.VisualBasic: + return GetHeaderLength(docStart, "'"); + + case CodeLanguage.JSON: + case CodeLanguage.Unknown: + default: + return 0; + } + } + + /// + /// Computes the length of the header + /// + /// The beginning of the document containing the header + /// The syntax of the comment tag in the processed language + /// The header length + /// EnvDTE API only counts 1 character per end of line (\r\n counts for 1) + internal static int GetHeaderLength(string docStart, string commentSyntax) + { + if (!docStart.TrimStart().StartsWith(commentSyntax)) + { + return 0; + } + + var separator = new string[] { Environment.NewLine }; + var lines = docStart.Split(separator, StringSplitOptions.None); + var header = new List(); + + // adds starting empty lines + foreach (var line in lines) + { + if (!string.IsNullOrWhiteSpace(line)) + { + break; + } + + header.Add(line); + } + + // adds comment lines + foreach (var line in lines.ToList().Skip(header.Count)) + { + if (!line.StartsWith(commentSyntax)) + { + break; + } + + header.Add(line); + } + + var nbChar = 0; + header.ToList().ForEach(x => nbChar += x.Length + 1); + + return nbChar; + } + + /// + /// Computes the length of the header + /// + /// The beginning of the document containing the header + /// The syntax of the comment tag start in the processed language + /// The syntax of the comment tag end in the processed language + /// The header length + /// EnvDTE API only counts 1 character per end of line (\r\n counts for 1) + internal static int GetHeaderLength(string docStart, string commentSyntaxStart, string commentSyntaxEnd) + { + if (!docStart.TrimStart().StartsWith(commentSyntaxStart)) + { + return 0; + } + + var endIndex = docStart.IndexOf(commentSyntaxEnd); + + if (endIndex == -1) + { + return 0; + } + + var headerBlock = docStart.Substring(0, endIndex); + var nbNewLines = Regex.Matches(headerBlock, Environment.NewLine).Count; + + return docStart.IndexOf(commentSyntaxEnd) + commentSyntaxEnd.Length - nbNewLines; + } + } +} \ No newline at end of file diff --git a/CodeMaid/Logic/Cleaning/FileHeaderLogic.cs b/CodeMaid/Logic/Cleaning/FileHeaderLogic.cs index d16bb8dc4..52527cece 100644 --- a/CodeMaid/Logic/Cleaning/FileHeaderLogic.cs +++ b/CodeMaid/Logic/Cleaning/FileHeaderLogic.cs @@ -1,6 +1,7 @@ using EnvDTE; using SteveCadwallader.CodeMaid.Helpers; using SteveCadwallader.CodeMaid.Properties; +using SteveCadwallader.CodeMaid.UI.Enumerations; using System; namespace SteveCadwallader.CodeMaid.Logic.Cleaning @@ -14,6 +15,8 @@ internal class FileHeaderLogic private readonly CodeMaidPackage _package; + private const int HeaderMaxNbLines = 60; + #endregion Fields #region Constructors @@ -52,16 +55,30 @@ private FileHeaderLogic(CodeMaidPackage package) /// The text document to update. internal void UpdateFileHeader(TextDocument textDocument) { - var settingsFileHeader = GetFileHeaderFromSettings(textDocument); + var settingsFileHeader = FileHeaderHelper.GetFileHeaderFromSettings(textDocument); if (string.IsNullOrWhiteSpace(settingsFileHeader)) { return; } + switch ((HeaderUpdateMode)Settings.Default.Cleaning_UpdateFileHeader_HeaderUpdateMode) + { + case HeaderUpdateMode.Insert: + InsertFileHeader(textDocument, settingsFileHeader); + break; + + case HeaderUpdateMode.Replace: + ReplaceFileHeader(textDocument, settingsFileHeader); + break; + } + } + + private void InsertFileHeader(TextDocument textDocument, string settingsFileHeader) + { var cursor = textDocument.StartPoint.CreateEditPoint(); var existingFileHeader = cursor.GetText(settingsFileHeader.Length); - if (!existingFileHeader.StartsWith(settingsFileHeader)) + if (!existingFileHeader.StartsWith(settingsFileHeader.TrimStart())) { cursor.Insert(settingsFileHeader); cursor.Insert(Environment.NewLine); @@ -69,32 +86,32 @@ internal void UpdateFileHeader(TextDocument textDocument) } /// - /// Gets the file header from settings based on the language of the specified document. + /// Reads the first lines of a document /// - /// The text document. - /// A file header from settings. - private static string GetFileHeaderFromSettings(TextDocument textDocument) + /// The document to read + /// A string representing the first lines of the document + private string ReadHeaderBlock(TextDocument textDocument) { - switch (textDocument.GetCodeLanguage()) + var headerNbLines = Math.Min(HeaderMaxNbLines, textDocument.EndPoint.Line); + var headerBlockStart = textDocument.StartPoint.CreateEditPoint(); + + return headerBlockStart.GetLines(1, headerNbLines); + } + + private void ReplaceFileHeader(TextDocument textDocument, string settingsFileHeader) + { + var headerBlock = ReadHeaderBlock(textDocument); + var currentHeaderLength = FileHeaderHelper.GetHeaderLength(textDocument.GetCodeLanguage(), headerBlock); + var currentHeader = headerBlock.Substring(0, currentHeaderLength + 1) + Environment.NewLine; + var newHeader = settingsFileHeader + Environment.NewLine; + + if (string.Equals(currentHeader, newHeader)) { - case CodeLanguage.CPlusPlus: return Settings.Default.Cleaning_UpdateFileHeaderCPlusPlus; - case CodeLanguage.CSharp: return Settings.Default.Cleaning_UpdateFileHeaderCSharp; - case CodeLanguage.CSS: return Settings.Default.Cleaning_UpdateFileHeaderCSS; - case CodeLanguage.FSharp: return Settings.Default.Cleaning_UpdateFileHeaderFSharp; - case CodeLanguage.HTML: return Settings.Default.Cleaning_UpdateFileHeaderHTML; - case CodeLanguage.JavaScript: return Settings.Default.Cleaning_UpdateFileHeaderJavaScript; - case CodeLanguage.JSON: return Settings.Default.Cleaning_UpdateFileHeaderJSON; - case CodeLanguage.LESS: return Settings.Default.Cleaning_UpdateFileHeaderLESS; - case CodeLanguage.PHP: return Settings.Default.Cleaning_UpdateFileHeaderPHP; - case CodeLanguage.PowerShell: return Settings.Default.Cleaning_UpdateFileHeaderPowerShell; - case CodeLanguage.R: return Settings.Default.Cleaning_UpdateFileHeaderR; - case CodeLanguage.SCSS: return Settings.Default.Cleaning_UpdateFileHeaderSCSS; - case CodeLanguage.TypeScript: return Settings.Default.Cleaning_UpdateFileHeaderTypeScript; - case CodeLanguage.VisualBasic: return Settings.Default.Cleaning_UpdateFileHeaderVB; - case CodeLanguage.XAML: return Settings.Default.Cleaning_UpdateFileHeaderXAML; - case CodeLanguage.XML: return Settings.Default.Cleaning_UpdateFileHeaderXML; - default: return null; + return; } + + var docStart = textDocument.StartPoint.CreateEditPoint(); + docStart.ReplaceText(currentHeaderLength, newHeader, (int)vsEPReplaceTextOptions.vsEPReplaceTextKeepMarkers); } #endregion Methods diff --git a/CodeMaid/Properties/Settings.Designer.cs b/CodeMaid/Properties/Settings.Designer.cs index e6eba1674..644978405 100644 --- a/CodeMaid/Properties/Settings.Designer.cs +++ b/CodeMaid/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace SteveCadwallader.CodeMaid.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -2270,5 +2270,17 @@ public sealed partial class Settings : global::System.Configuration.ApplicationS this["Cleaning_InclusionExpression"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int Cleaning_UpdateFileHeader_HeaderUpdateMode { + get { + return ((int)(this["Cleaning_UpdateFileHeader_HeaderUpdateMode"])); + } + set { + this["Cleaning_UpdateFileHeader_HeaderUpdateMode"] = value; + } + } } } diff --git a/CodeMaid/Properties/Settings.settings b/CodeMaid/Properties/Settings.settings index d5337c0af..a67dd04aa 100644 --- a/CodeMaid/Properties/Settings.settings +++ b/CodeMaid/Properties/Settings.settings @@ -567,5 +567,8 @@ + + + \ No newline at end of file diff --git a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateDataTemplate.xaml b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateDataTemplate.xaml index 98cc3cd73..7bdcea2b6 100644 --- a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateDataTemplate.xaml +++ b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateDataTemplate.xaml @@ -1,7 +1,9 @@ + xmlns:local="clr-namespace:SteveCadwallader.CodeMaid.UI.Dialogs.Options.Cleaning" + xmlns:converters="clr-namespace:SteveCadwallader.CodeMaid.UI.Converters" + xmlns:enums="clr-namespace:SteveCadwallader.CodeMaid.UI.Enumerations"> @@ -14,7 +16,15 @@ - + + + + + + + + + diff --git a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateViewModel.cs b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateViewModel.cs index f2fa842a6..46facc25b 100644 --- a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateViewModel.cs +++ b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateViewModel.cs @@ -1,4 +1,5 @@ using SteveCadwallader.CodeMaid.Properties; +using SteveCadwallader.CodeMaid.UI.Enumerations; namespace SteveCadwallader.CodeMaid.UI.Dialogs.Options.Cleaning { @@ -21,6 +22,7 @@ public CleaningUpdateViewModel(CodeMaidPackage package, Settings activeSettings) { new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateAccessorsToBothBeSingleLineOrMultiLine, x => UpdateAccessorsToBothBeSingleLineOrMultiLine), new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateEndRegionDirectives, x => UpdateEndRegionDirectives), + new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateFileHeader_HeaderUpdateMode, x => HeaderUpdateMode), new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateFileHeaderCPlusPlus, x => UpdateFileHeaderCPlusPlus), new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateFileHeaderCSharp, x => UpdateFileHeaderCSharp), new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateFileHeaderCSS, x => UpdateFileHeaderCSS), @@ -54,6 +56,15 @@ public CleaningUpdateViewModel(CodeMaidPackage package, Settings activeSettings) #region Options + /// + /// Gets or sets the position of the file header. + /// + public HeaderUpdateMode HeaderUpdateMode + { + get { return GetPropertyValue(); } + set { SetPropertyValue(value); } + } + /// /// Gets or sets the flag indicating if accessors should be updated to both be single line /// or multi line. diff --git a/CodeMaid/UI/Enumerations/HeaderUpdateMode.cs b/CodeMaid/UI/Enumerations/HeaderUpdateMode.cs new file mode 100644 index 000000000..b0bc6f072 --- /dev/null +++ b/CodeMaid/UI/Enumerations/HeaderUpdateMode.cs @@ -0,0 +1,8 @@ +namespace SteveCadwallader.CodeMaid.UI.Enumerations +{ + public enum HeaderUpdateMode + { + Insert = 0, + Replace = 1, + } +} \ No newline at end of file diff --git a/CodeMaid/app.config b/CodeMaid/app.config index dc6f03e9a..001d77bac 100644 --- a/CodeMaid/app.config +++ b/CodeMaid/app.config @@ -573,6 +573,9 @@ + + + From 18b6d70054fa558337c2f6031bad38d38ec8bed3 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Fri, 7 May 2021 08:07:05 -0400 Subject: [PATCH 06/15] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da18d80ac..b04e5a212 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ These changes have not been released to the Visual Studio marketplace, but (if c - [ ] Features - [x] [#778](https://github.com/codecadwallader/codemaid/pull/778) - Cleaning: Option to specify file inclusions by RegEx - thanks [Timo-Weike](https://github.com/Timo-Weike)! + - [x] [#797](https://github.com/codecadwallader/codemaid/pull/797) - Cleaning: Option to replace existing file headers (vs. default insert) - thanks [lflender](https://github.com/lflender)! - [ ] Fixes - [x] [#800](https://github.com/codecadwallader/codemaid/pull/800) - Reorganizing: Fix dialog showing literal newline characters From 497c5bf94501a55806bfb816d32f429409a5a1d8 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Fri, 14 May 2021 09:19:15 -0400 Subject: [PATCH 07/15] Temporarily commented out build event registration related to issue #795 --- CodeMaid/CodeMaidPackage.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CodeMaid/CodeMaidPackage.cs b/CodeMaid/CodeMaidPackage.cs index fe4c0fe82..4692c5d5b 100644 --- a/CodeMaid/CodeMaidPackage.cs +++ b/CodeMaid/CodeMaidPackage.cs @@ -278,11 +278,12 @@ private async Task RegisterEventListenersAsync() VSColorTheme.ThemeChanged += _ => ThemeManager.ApplyTheme(); - await BuildProgressEventListener.InitializeAsync(this); - BuildProgressEventListener.Instance.BuildBegin += BuildProgressToolWindowCommand.Instance.OnBuildBegin; - BuildProgressEventListener.Instance.BuildProjConfigBegin += BuildProgressToolWindowCommand.Instance.OnBuildProjConfigBegin; - BuildProgressEventListener.Instance.BuildProjConfigDone += BuildProgressToolWindowCommand.Instance.OnBuildProjConfigDone; - BuildProgressEventListener.Instance.BuildDone += BuildProgressToolWindowCommand.Instance.OnBuildDone; + //TODO: Temporarily commented out build event registration related to issue #795 + //await BuildProgressEventListener.InitializeAsync(this); + //BuildProgressEventListener.Instance.BuildBegin += BuildProgressToolWindowCommand.Instance.OnBuildBegin; + //BuildProgressEventListener.Instance.BuildProjConfigBegin += BuildProgressToolWindowCommand.Instance.OnBuildProjConfigBegin; + //BuildProgressEventListener.Instance.BuildProjConfigDone += BuildProgressToolWindowCommand.Instance.OnBuildProjConfigDone; + //BuildProgressEventListener.Instance.BuildDone += BuildProgressToolWindowCommand.Instance.OnBuildDone; await DocumentEventListener.InitializeAsync(this); DocumentEventListener.Instance.OnDocumentClosing += codeModelManager.OnDocumentClosing; From f745080a6333005072a945171a03623db7163312 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Fri, 14 May 2021 09:28:25 -0400 Subject: [PATCH 08/15] Temporarily commented out build event registration related to issue #795 --- .../Events/BuildProgressEventListener.cs | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/CodeMaid/Integration/Events/BuildProgressEventListener.cs b/CodeMaid/Integration/Events/BuildProgressEventListener.cs index f2f70afe3..ff047fc3d 100644 --- a/CodeMaid/Integration/Events/BuildProgressEventListener.cs +++ b/CodeMaid/Integration/Events/BuildProgressEventListener.cs @@ -16,8 +16,10 @@ internal sealed class BuildProgressEventListener : BaseEventListener private BuildProgressEventListener(CodeMaidPackage package) : base(package) { + //TODO: Temporarily commented out build event registration related to issue #795 + // Store access to the build events, otherwise events will not register properly via DTE. - BuildEvents = Package.IDE.Events.BuildEvents; + //BuildEvents = Package.IDE.Events.BuildEvents; } /// @@ -66,10 +68,12 @@ public static async Task InitializeAsync(CodeMaidPackage package) /// protected override void RegisterListeners() { - BuildEvents.OnBuildBegin += BuildEvents_OnBuildBegin; - BuildEvents.OnBuildProjConfigBegin += BuildEvents_OnBuildProjConfigBegin; - BuildEvents.OnBuildProjConfigDone += BuildEvents_OnBuildProjConfigDone; - BuildEvents.OnBuildDone += BuildEvents_OnBuildDone; + //TODO: Temporarily commented out build event registration related to issue #795 + + //BuildEvents.OnBuildBegin += BuildEvents_OnBuildBegin; + //BuildEvents.OnBuildProjConfigBegin += BuildEvents_OnBuildProjConfigBegin; + //BuildEvents.OnBuildProjConfigDone += BuildEvents_OnBuildProjConfigDone; + //BuildEvents.OnBuildDone += BuildEvents_OnBuildDone; } /// @@ -77,10 +81,12 @@ protected override void RegisterListeners() /// protected override void UnRegisterListeners() { - BuildEvents.OnBuildBegin -= BuildEvents_OnBuildBegin; - BuildEvents.OnBuildProjConfigBegin -= BuildEvents_OnBuildProjConfigBegin; - BuildEvents.OnBuildProjConfigDone -= BuildEvents_OnBuildProjConfigDone; - BuildEvents.OnBuildDone -= BuildEvents_OnBuildDone; + //TODO: Temporarily commented out build event registration related to issue #795 + + //BuildEvents.OnBuildBegin -= BuildEvents_OnBuildBegin; + //BuildEvents.OnBuildProjConfigBegin -= BuildEvents_OnBuildProjConfigBegin; + //BuildEvents.OnBuildProjConfigDone -= BuildEvents_OnBuildProjConfigDone; + //BuildEvents.OnBuildDone -= BuildEvents_OnBuildDone; } /// From 102d18af3e2c18268d51b9e0b6bee5afe130a2a4 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Thu, 24 Jun 2021 08:35:05 -0400 Subject: [PATCH 09/15] Undo temporarily commented out code --- CodeMaid/CodeMaidPackage.cs | 11 ++++----- .../Events/BuildProgressEventListener.cs | 24 +++++++------------ 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/CodeMaid/CodeMaidPackage.cs b/CodeMaid/CodeMaidPackage.cs index 4692c5d5b..fe4c0fe82 100644 --- a/CodeMaid/CodeMaidPackage.cs +++ b/CodeMaid/CodeMaidPackage.cs @@ -278,12 +278,11 @@ private async Task RegisterEventListenersAsync() VSColorTheme.ThemeChanged += _ => ThemeManager.ApplyTheme(); - //TODO: Temporarily commented out build event registration related to issue #795 - //await BuildProgressEventListener.InitializeAsync(this); - //BuildProgressEventListener.Instance.BuildBegin += BuildProgressToolWindowCommand.Instance.OnBuildBegin; - //BuildProgressEventListener.Instance.BuildProjConfigBegin += BuildProgressToolWindowCommand.Instance.OnBuildProjConfigBegin; - //BuildProgressEventListener.Instance.BuildProjConfigDone += BuildProgressToolWindowCommand.Instance.OnBuildProjConfigDone; - //BuildProgressEventListener.Instance.BuildDone += BuildProgressToolWindowCommand.Instance.OnBuildDone; + await BuildProgressEventListener.InitializeAsync(this); + BuildProgressEventListener.Instance.BuildBegin += BuildProgressToolWindowCommand.Instance.OnBuildBegin; + BuildProgressEventListener.Instance.BuildProjConfigBegin += BuildProgressToolWindowCommand.Instance.OnBuildProjConfigBegin; + BuildProgressEventListener.Instance.BuildProjConfigDone += BuildProgressToolWindowCommand.Instance.OnBuildProjConfigDone; + BuildProgressEventListener.Instance.BuildDone += BuildProgressToolWindowCommand.Instance.OnBuildDone; await DocumentEventListener.InitializeAsync(this); DocumentEventListener.Instance.OnDocumentClosing += codeModelManager.OnDocumentClosing; diff --git a/CodeMaid/Integration/Events/BuildProgressEventListener.cs b/CodeMaid/Integration/Events/BuildProgressEventListener.cs index ff047fc3d..f2f70afe3 100644 --- a/CodeMaid/Integration/Events/BuildProgressEventListener.cs +++ b/CodeMaid/Integration/Events/BuildProgressEventListener.cs @@ -16,10 +16,8 @@ internal sealed class BuildProgressEventListener : BaseEventListener private BuildProgressEventListener(CodeMaidPackage package) : base(package) { - //TODO: Temporarily commented out build event registration related to issue #795 - // Store access to the build events, otherwise events will not register properly via DTE. - //BuildEvents = Package.IDE.Events.BuildEvents; + BuildEvents = Package.IDE.Events.BuildEvents; } /// @@ -68,12 +66,10 @@ public static async Task InitializeAsync(CodeMaidPackage package) /// protected override void RegisterListeners() { - //TODO: Temporarily commented out build event registration related to issue #795 - - //BuildEvents.OnBuildBegin += BuildEvents_OnBuildBegin; - //BuildEvents.OnBuildProjConfigBegin += BuildEvents_OnBuildProjConfigBegin; - //BuildEvents.OnBuildProjConfigDone += BuildEvents_OnBuildProjConfigDone; - //BuildEvents.OnBuildDone += BuildEvents_OnBuildDone; + BuildEvents.OnBuildBegin += BuildEvents_OnBuildBegin; + BuildEvents.OnBuildProjConfigBegin += BuildEvents_OnBuildProjConfigBegin; + BuildEvents.OnBuildProjConfigDone += BuildEvents_OnBuildProjConfigDone; + BuildEvents.OnBuildDone += BuildEvents_OnBuildDone; } /// @@ -81,12 +77,10 @@ protected override void RegisterListeners() /// protected override void UnRegisterListeners() { - //TODO: Temporarily commented out build event registration related to issue #795 - - //BuildEvents.OnBuildBegin -= BuildEvents_OnBuildBegin; - //BuildEvents.OnBuildProjConfigBegin -= BuildEvents_OnBuildProjConfigBegin; - //BuildEvents.OnBuildProjConfigDone -= BuildEvents_OnBuildProjConfigDone; - //BuildEvents.OnBuildDone -= BuildEvents_OnBuildDone; + BuildEvents.OnBuildBegin -= BuildEvents_OnBuildBegin; + BuildEvents.OnBuildProjConfigBegin -= BuildEvents_OnBuildProjConfigBegin; + BuildEvents.OnBuildProjConfigDone -= BuildEvents_OnBuildProjConfigDone; + BuildEvents.OnBuildDone -= BuildEvents_OnBuildDone; } /// From 24229534f7cdd34fb25c0b3fe2ee86ccb3592707 Mon Sep 17 00:00:00 2001 From: lflender Date: Sun, 18 Jul 2021 22:09:47 +0200 Subject: [PATCH 10/15] Added an option to update file headers after the "using" block in C# (#815) * File header update now replaces the file header if one is already present Fixing issues #790 #757 * Adding option to choose between Insert or Replace file header * Addressing PR comments * Added an option to update file headers after using blocks for C# * Fixed file header update crashing when replacing with a header not ending with newline Co-authored-by: lflender --- .../Helpers/FileHeaderHelperTests.cs | 124 +++++++-- CodeMaid/CodeMaid.csproj | 1 + CodeMaid/Helpers/FileHeaderHelper.cs | 251 +++++++++++++++--- CodeMaid/Logic/Cleaning/FileHeaderLogic.cs | 158 ++++++++++- CodeMaid/Properties/Settings.Designer.cs | 12 + CodeMaid/Properties/Settings.settings | 3 + .../Cleaning/CleaningUpdateDataTemplate.xaml | 18 +- .../Cleaning/CleaningUpdateViewModel.cs | 16 +- CodeMaid/UI/Enumerations/HeaderPosition.cs | 8 + CodeMaid/app.config | 3 + 10 files changed, 509 insertions(+), 85 deletions(-) create mode 100644 CodeMaid/UI/Enumerations/HeaderPosition.cs diff --git a/CodeMaid.UnitTests/Helpers/FileHeaderHelperTests.cs b/CodeMaid.UnitTests/Helpers/FileHeaderHelperTests.cs index be577eb2f..9cc46d871 100644 --- a/CodeMaid.UnitTests/Helpers/FileHeaderHelperTests.cs +++ b/CodeMaid.UnitTests/Helpers/FileHeaderHelperTests.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Text.RegularExpressions; using Microsoft.VisualStudio.TestTools.UnitTesting; using NUnit.Framework; @@ -40,11 +41,11 @@ public class FileHeaderHelperTests [TestCase(CodeLanguage.FSharp, "// some F# test header\r\n")] [TestCase(CodeLanguage.FSharp, "(* some F#\r\n test \r\nheader\r\n*)")] [TestCase(CodeLanguage.VisualBasic, "' some PowerShell test header\r\n")] - public void GetHeaderLengthLanguage(CodeLanguage language, string docStart) + public void GetHeaderLengthLanguage(CodeLanguage language, string text) { - var headerLength = FileHeaderHelper.GetHeaderLength(language, docStart); + var headerLength = FileHeaderHelper.GetHeaderLength(language, text); - Assert.IsTrue(headerLength > 0); + Assert.IsTrue(headerLength > 0, $"Expecting value > 0, found {headerLength}"); } [TestCase(CodeLanguage.CSharp, "# some CSharp test header\r\n")] @@ -62,11 +63,11 @@ public void GetHeaderLengthLanguage(CodeLanguage language, string docStart) [TestCase(CodeLanguage.R, "// some R test header\r\n")] [TestCase(CodeLanguage.FSharp, "/* some F#\r\n test \r\nheader\r\n*/")] [TestCase(CodeLanguage.VisualBasic, "// some PowerShell test header\r\n")] - public void GetHeaderLengthLanguageWithWrongTags(CodeLanguage language, string docStart) + public void GetHeaderLengthLanguageWithWrongTags(CodeLanguage language, string text) { - var headerLength = FileHeaderHelper.GetHeaderLength(language, docStart); + var headerLength = FileHeaderHelper.GetHeaderLength(language, text); - Assert.IsTrue(headerLength == 0); + Assert.IsTrue(headerLength == 0, $"Expecting 0, found {headerLength}"); } [TestCase("/* */", "/*", "*/")] @@ -77,23 +78,41 @@ public void GetHeaderLengthLanguageWithWrongTags(CodeLanguage language, string d [TestCase("<# //////////////// \r\n Copyright © 2021 \r\n //////////////// #>", "<#", "#>")] [TestCase("(* *)", "(*", "*)")] [TestCase("(* ~~~~ \r\n ~~ \r\n Copyright © 2021 \r\n ~~ \r\n ~~~~ *)", "(*", "*)")] - public void GetHeaderLengthMultiLine(string docStart, string tagStart, string beaconEnd) + public void GetHeaderLengthMultiLine(string text, string tagStart, string tagEnd) { - var headerLength = FileHeaderHelper.GetHeaderLength(docStart, tagStart, beaconEnd); - var length = docStart.Length - Regex.Matches(docStart, Environment.NewLine).Count; + var headerLength = FileHeaderHelper.GetHeaderLength(text, tagStart, tagEnd, false); + var expectedLength = text.Length - Regex.Matches(text, Environment.NewLine).Count + 1; - Assert.IsTrue(headerLength == length); + Assert.IsTrue(headerLength == expectedLength, $"Expecting {expectedLength}, found {headerLength}"); + } + + [TestCase("using System;\r\n/* */", "/*", "*/", 6)] + [TestCase("using EnvDTE;\r\nusing System;\r\nusing SteveCadwallader.CodeMaid.Helpers;\r\n/* \r\n Copyright © 2021 \r\n */", "/*", "*/", 29)] + public void GetHeaderLengthMultiLineSkipUsings(string text, string tagStart, string tagEnd, int expectedLength) + { + var headerLength = FileHeaderHelper.GetHeaderLength(text, tagStart, tagEnd, true); + + Assert.IsTrue(headerLength == expectedLength, $"Expecting {expectedLength}, found {headerLength}"); } [TestCase("\r\n/* */", "/*", "*/")] [TestCase("\r\n\r\n\r\n/* Copyright © 2021 */", "/*", "*/")] [TestCase("\r\n\r\n", "")] - public void GetHeaderLengthMultiLineWithEmptyLines(string docStart, string tagStart, string tagEnd) + public void GetHeaderLengthMultiLineWithEmptyLines(string text, string tagStart, string tagEnd) + { + var headerLength = FileHeaderHelper.GetHeaderLength(text, tagStart, tagEnd, false); + var expectedLength = text.Length - Regex.Matches(text, Environment.NewLine).Count + 1; + + Assert.IsTrue(headerLength == expectedLength, $"Expecting {expectedLength}, found {headerLength}"); + } + + [TestCase("using EnvDTE;\r\nusing System;\r\nusing SteveCadwallader.CodeMaid.Helpers;\r\n\r\n\r\n/* \r\n Copyright © 2021 \r\n */", "/*", "*/", 29)] + [TestCase("using System;\r\n\r\n", "", 9)] + public void GetHeaderLengthMultiLineWithEmptyLinesSkipUsings(string text, string tagStart, string tagEnd, int expectedLength) { - var headerLength = FileHeaderHelper.GetHeaderLength(docStart, tagStart, tagEnd); - var value = docStart.Length - Regex.Matches(docStart, Environment.NewLine).Count; + var headerLength = FileHeaderHelper.GetHeaderLength(text, tagStart, tagEnd, true); - Assert.IsTrue(headerLength == value); + Assert.IsTrue(headerLength == expectedLength, $"Expecting {expectedLength}, found {headerLength}"); } [TestCase("", "/*", "*/")] @@ -101,11 +120,22 @@ public void GetHeaderLengthMultiLineWithEmptyLines(string docStart, string tagSt [TestCase("/* \r\n \r\n ", "/*", "*/")] [TestCase("/* header */", "/*", "*>")] [TestCase("*/ ", "/*", "*/")] - public void GetHeaderLengthMultiLineZero(string docStart, string tagStart, string tagEnd) + public void GetHeaderLengthMultiLineZero(string text, string tagStart, string tagEnd) { - var headerLength = FileHeaderHelper.GetHeaderLength(docStart, tagStart, tagEnd); + var headerLength = FileHeaderHelper.GetHeaderLength(text, tagStart, tagEnd, false); - Assert.IsTrue(headerLength == 0); + Assert.IsTrue(headerLength == 0, $"Expecting 0, found {headerLength}"); + } + + [TestCase("using System;", "/*", "*/")] + [TestCase("using System;\r\n/* \r\n \r\n ", "/*", "*/")] + [TestCase("using System;\r\n/* header */", "/*", "*>")] + [TestCase("using System;\r\n*/ ", "/*", "*/")] + public void GetHeaderLengthMultiLineZeroSkipUsings(string text, string tagStart, string tagEnd) + { + var headerLength = FileHeaderHelper.GetHeaderLength(text, tagStart, tagEnd, true); + + Assert.IsTrue(headerLength == 0, $"Expecting 0, found {headerLength}"); } [TestCase("//", "// header fdsfndksjnfe\r\n")] @@ -114,34 +144,74 @@ public void GetHeaderLengthMultiLineZero(string docStart, string tagStart, strin [TestCase("//", "// ====================\r\n// Copyright\r\n// ====================\r\n")] [TestCase("#", "# ==============\r\n# Copyright !\r\n# ~~\r\n# ==============\r\n")] [TestCase("'", "' ==============\r\n' some text\r\n' Copyright !\r\n' ==============\r\n")] - public void GetHeaderLengthMultiSingleLine(string tag, string docStart) + public void GetHeaderLengthMultiSingleLine(string tag, string text) + { + var headerLength = FileHeaderHelper.GetHeaderLength(text, tag, false); + var expectedLength = text.Length - Regex.Matches(text, Environment.NewLine).Count; + + Assert.IsTrue(headerLength == expectedLength, $"Expecting {expectedLength}, found {headerLength}"); + } + + [TestCase("//", "using System;\r\n// header\r\n", 11)] + [TestCase("//", "using System;\r\n// header I\r\n// header II\r\n", 26)] + public void GetHeaderLengthMultiSingleLineSkipUsings(string tag, string text, int expectedLength) { - var headerLength = FileHeaderHelper.GetHeaderLength(docStart, tag); - var length = docStart.Length - Regex.Matches(docStart, Environment.NewLine).Count; + var headerLength = FileHeaderHelper.GetHeaderLength(text, tag, true); - Assert.IsTrue(headerLength == length); + Assert.IsTrue(headerLength == expectedLength, $"Expecting {expectedLength}, found {headerLength}"); } [TestCase("//", "// header \r\nnamespace\r\npublic class Test\r\n", 12)] [TestCase("//", "// header \r\n// more header \r\n some code\r\n", 28)] [TestCase("#", "# some header\r\nnamespace\r\npublic class Test\r\n", 14)] [TestCase("'", "' some header\r\nnamespace\r\npublic class Test\r\n", 14)] - public void GetHeaderLengthMultiSingleLineWithCode(string tag, string docStart, int expectedLength) + public void GetHeaderLengthMultiSingleLineWithCode(string tag, string text, int expectedLength) { - var headerLength = FileHeaderHelper.GetHeaderLength(docStart, tag); + var headerLength = FileHeaderHelper.GetHeaderLength(text, tag, false); - Assert.IsTrue(headerLength == expectedLength); + Assert.IsTrue(headerLength == expectedLength, $"Expecting {expectedLength}, found {headerLength}"); + } + + [TestCase("//", "using System;\r\n\r\n// header \r\nnamespace System.Windows;\r\npublic class Test\r\n", 13)] + [TestCase("//", "using EnvDTE;\r\nusing System;\r\nusing SteveCadwallader.CodeMaid.Helpers;\r\n\r\n\r\n// header \r\n// more header \r\nnamespace SteveCadwallader.CodeMaid;\r\n", 29)] + [TestCase("//", "using System;\r\n\r\n// header \r\n[assembly: AssemblyTitle(\"SteveCadwallader.CodeMaid.UnitTests\")]\r\n", 13)] + public void GetHeaderLengthMultiSingleLineWithCodeSkipUsings(string tag, string text, int expectedLength) + { + var headerLength = FileHeaderHelper.GetHeaderLength(text, tag, true); + + Assert.IsTrue(headerLength == expectedLength, $"Expecting {expectedLength}, found {headerLength}"); } [TestCase("//", "\r\n// header \r\n// header\r\nnamespace\r\n//not header\r\n public class Test\r\n", 23)] [TestCase("//", "\r\n\r\n\r\n// header \r\n// more header \r\n some code\r\n", 31)] [TestCase("#", "\r\n# some header\r\nnamespace\r\npublic class Test\r\n", 15)] [TestCase("'", "\r\n' some header\r\nnamespace\r\npublic class Test\r\n", 15)] - public void GetHeaderLengthMultiSingleLineWithEmptyLines(string tag, string docStart, int expectedLength) + public void GetHeaderLengthMultiSingleLineWithEmptyLines(string tag, string text, int expectedLength) + { + var headerLength = FileHeaderHelper.GetHeaderLength(text, tag, false); + + Assert.IsTrue(headerLength == expectedLength, $"Expecting {expectedLength}, found {headerLength}"); + } + + [TestCase("//", "using System;\r\n\r\n\r\n// header \r\n// header\r\nnamespace\r\n//not header\r\n public class Test\r\n", 23)] + [TestCase("//", "using EnvDTE;\r\nusing System;\r\nusing SteveCadwallader.CodeMaid.Helpers;\r\n// header \r\n// more header \r\n namespace System.Text;\r\n{\r\n", 29)] + public void GetHeaderLengthMultiSingleLineWithEmptyLinesSkipUsings(string tag, string text, int expectedLength) + { + var headerLength = FileHeaderHelper.GetHeaderLength(text, tag, true); + + Assert.IsTrue(headerLength == expectedLength, $"Expecting {expectedLength}, found {headerLength}"); + } + + [TestCase("using ", "", "", 0)] + [TestCase(" using", "using System;\r\nnamespace CodeMaid", "namespace ", 0)] + [TestCase("using ", " using System;\r\nnamespace CodeMaid", "namespace ", 1)] + [TestCase("using ", "using System;\r\nusing System.Collections;\r\n\r\nnamespace CodeMaid", "namespace ", 2)] + [TestCase("using ", "using System;\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nusing System.Collections;\r\n\r\nnamespace CodeMaid", "namespace ", 10)] + public void GetNbLinesToSkip(string patternToFind, string text, string limit, int expectedNbLines) { - var headerLength = FileHeaderHelper.GetHeaderLength(docStart, tag); + var nbLines = FileHeaderHelper.GetNbLinesToSkip(patternToFind, text, new List() { limit }); - Assert.IsTrue(headerLength == expectedLength); + Assert.IsTrue(nbLines == expectedNbLines, $"Expecting {expectedNbLines}, found {expectedNbLines}"); } } } \ No newline at end of file diff --git a/CodeMaid/CodeMaid.csproj b/CodeMaid/CodeMaid.csproj index 8b5b27712..e2dacbbd9 100644 --- a/CodeMaid/CodeMaid.csproj +++ b/CodeMaid/CodeMaid.csproj @@ -422,6 +422,7 @@ + diff --git a/CodeMaid/Helpers/FileHeaderHelper.cs b/CodeMaid/Helpers/FileHeaderHelper.cs index 3db72a560..7efe3bada 100644 --- a/CodeMaid/Helpers/FileHeaderHelper.cs +++ b/CodeMaid/Helpers/FileHeaderHelper.cs @@ -1,5 +1,6 @@ using EnvDTE; using SteveCadwallader.CodeMaid.Properties; +using SteveCadwallader.CodeMaid.UI.Enumerations; using System; using System.Collections.Generic; using System.Linq; @@ -38,45 +39,60 @@ internal static string GetFileHeaderFromSettings(TextDocument textDocument) } } - internal static int GetHeaderLength(CodeLanguage language, string docStart) + internal static HeaderPosition GetFileHeaderPositionFromSettings(TextDocument textDocument) + { + switch (textDocument.GetCodeLanguage()) + { + case CodeLanguage.CSharp: + return (HeaderPosition)Settings.Default.Cleaning_UpdateFileHeader_HeaderPosition; + + default: + return HeaderPosition.DocumentStart; + } + } + + internal static int GetHeaderLength(CodeLanguage language, string text, bool skipUsings = false) { switch (language) { case CodeLanguage.CSharp: + return GetHeaderLength(text, "//", skipUsings) + + GetHeaderLength(text, "/*", "*/", skipUsings); + case CodeLanguage.CPlusPlus: case CodeLanguage.JavaScript: case CodeLanguage.LESS: case CodeLanguage.SCSS: case CodeLanguage.TypeScript: - return GetHeaderLength(docStart, "//") + - GetHeaderLength(docStart, "/*", "*/"); + return GetHeaderLength(text, "//") + + GetHeaderLength(text, "/*", "*/"); case CodeLanguage.HTML: case CodeLanguage.XAML: case CodeLanguage.XML: - return GetHeaderLength(docStart, ""); + return GetHeaderLength(text, ""); case CodeLanguage.CSS: - return GetHeaderLength(docStart, "/*", "*/"); + return GetHeaderLength(text, "/*", "*/"); case CodeLanguage.PHP: - return GetHeaderLength(docStart, "//") + - GetHeaderLength(docStart, "#") + - GetHeaderLength(docStart, "/*", "*/"); + return GetHeaderLength(text, "//") + + GetHeaderLength(text, "#") + + GetHeaderLength(text, "/*", "*/"); case CodeLanguage.PowerShell: - return GetHeaderLength(docStart, "#") + - GetHeaderLength(docStart, "<#", "#>"); + return GetHeaderLength(text, "#") + + GetHeaderLength(text, "<#", "#>"); case CodeLanguage.R: - return GetHeaderLength(docStart, "#"); + return GetHeaderLength(text, "#"); case CodeLanguage.FSharp: - return GetHeaderLength(docStart, "//") + - GetHeaderLength(docStart, "(*", "*)"); + return GetHeaderLength(text, "//") + + GetHeaderLength(text, "(*", "*)"); case CodeLanguage.VisualBasic: - return GetHeaderLength(docStart, "'"); + return GetHeaderLength(text, "'"); case CodeLanguage.JSON: case CodeLanguage.Unknown: @@ -85,46 +101,86 @@ internal static int GetHeaderLength(CodeLanguage language, string docStart) } } + internal static int GetHeaderLength(string text, string commentSyntax, bool skipUsings) + { + if (skipUsings) + { + return GetHeaderLengthSkipUsings(text, commentSyntax); + } + + return GetHeaderLength(text, commentSyntax); + } + + internal static int GetHeaderLength(string text, string commentSyntaxStart, string commentSyntaxEnd, bool skipUsings) + { + if (skipUsings) + { + return GetHeaderLengthSkipUsings(text, commentSyntaxStart, commentSyntaxEnd); + } + + return GetHeaderLength(text, commentSyntaxStart, commentSyntaxEnd); + } + /// - /// Computes the length of the header + /// Gets the number of lines to skip to pass occurrences of /// - /// The beginning of the document containing the header - /// The syntax of the comment tag in the processed language - /// The header length - /// EnvDTE API only counts 1 character per end of line (\r\n counts for 1) - internal static int GetHeaderLength(string docStart, string commentSyntax) + /// The pattern of the start of lines we want to skip + /// The document to search + /// The limits not to pass. beyond those limits are ignored + /// The number of lines to skip + internal static int GetNbLinesToSkip(string startOfLine, string text, IEnumerable limits) { - if (!docStart.TrimStart().StartsWith(commentSyntax)) + var max = GetLowestIndex(text, limits); + var potentialTextBlock = text.Substring(0, max); + var lastIndex = potentialTextBlock.LastIndexOf(startOfLine); + + if (lastIndex == -1) { return 0; } - var separator = new string[] { Environment.NewLine }; - var lines = docStart.Split(separator, StringSplitOptions.None); - var header = new List(); + var relevantTextBlock = potentialTextBlock.Substring(0, lastIndex); - // adds starting empty lines - foreach (var line in lines) + return Regex.Matches(relevantTextBlock, Environment.NewLine).Count + 1; + } + + private static IEnumerable GetEmptyLines(IEnumerable lines, int nbLinesToSkip) + { + List result = new List(); + + foreach (var line in lines.Skip(nbLinesToSkip)) { if (!string.IsNullOrWhiteSpace(line)) { break; } - header.Add(line); + result.Add(line); } - // adds comment lines - foreach (var line in lines.ToList().Skip(header.Count)) - { - if (!line.StartsWith(commentSyntax)) - { - break; - } + return result; + } - header.Add(line); + /// + /// Computes the length of the header + /// + /// The beginning of the document containing the header + /// The syntax of the comment tag in the processed language + /// The header length + /// EnvDTE API only counts 1 character per end of line (\r\n counts for 1) + private static int GetHeaderLength(string text, string commentSyntax) + { + if (!text.TrimStart().StartsWith(commentSyntax)) + { + return 0; } + var lines = SplitLines(text); + var header = new List(); + + header.AddRange(GetEmptyLines(lines, 0)); + header.AddRange(GetLinesStartingWith(commentSyntax, lines, header.Count)); + var nbChar = 0; header.ToList().ForEach(x => nbChar += x.Length + 1); @@ -134,29 +190,138 @@ internal static int GetHeaderLength(string docStart, string commentSyntax) /// /// Computes the length of the header /// - /// The beginning of the document containing the header + /// The beginning of the document containing the header /// The syntax of the comment tag start in the processed language /// The syntax of the comment tag end in the processed language /// The header length /// EnvDTE API only counts 1 character per end of line (\r\n counts for 1) - internal static int GetHeaderLength(string docStart, string commentSyntaxStart, string commentSyntaxEnd) + private static int GetHeaderLength(string text, string commentSyntaxStart, string commentSyntaxEnd) { - if (!docStart.TrimStart().StartsWith(commentSyntaxStart)) + if (!text.TrimStart().StartsWith(commentSyntaxStart) || text.IndexOf(commentSyntaxEnd) == -1) { return 0; } - var endIndex = docStart.IndexOf(commentSyntaxEnd); + var lines = SplitLines(text); + var header = new List(); + + header.AddRange(GetEmptyLines(lines, 0)); - if (endIndex == -1) + foreach (var line in lines.Skip(header.Count())) + { + header.Add(line); + + if (line.TrimEnd().EndsWith(commentSyntaxEnd)) + { + break; + } + } + + var nbChar = 0; + header.ToList().ForEach(x => nbChar += x.Length + 1); + + return nbChar; + } + + private static int GetHeaderLengthSkipUsings(string text, string commentSyntax) + { + text = SkipUsings(text); + + var lines = SplitLines(text); + var header = new List(); + header.AddRange(GetLinesStartingWith(commentSyntax, lines)); + + var nbChar = 0; + header.ToList().ForEach(x => nbChar += x.Length + 1); + + return nbChar + 1; + } + + private static int GetHeaderLengthSkipUsings(string text, string commentSyntaxStart, string commentSyntaxEnd) + { + text = SkipUsings(text); + + var startIndex = text.IndexOf(commentSyntaxStart); + var endIndex = text.IndexOf(commentSyntaxEnd); + + if (startIndex == -1 || endIndex == -1) { return 0; } - var headerBlock = docStart.Substring(0, endIndex); - var nbNewLines = Regex.Matches(headerBlock, Environment.NewLine).Count; + var header = text.Substring(startIndex, endIndex - startIndex); + var nbNewLines = Regex.Matches(header, Environment.NewLine).Count; + return header.Length + commentSyntaxEnd.Length - nbNewLines + 1; + } + + private static IEnumerable GetLinesStartingWith(string pattern, IEnumerable lines, int nbLinesToSkip = 0) + { + List result = new List(); + + foreach (var line in lines.Skip(nbLinesToSkip)) + { + if (!line.StartsWith(pattern)) + { + break; + } + + result.Add(line); + } + + return result; + } + + /// + /// Looks for the index of the first limit found in the text + /// + /// The text to search in + /// The limits to search for + /// Lowest index of all the limits found + private static int GetLowestIndex(string text, IEnumerable limits) + { + List indexes = new List(); + + foreach (var limit in limits) + { + var limitIndex = text.IndexOf(limit); + + if (limitIndex > -1) + { + indexes.Add(limitIndex); + } + } + + if (indexes.Count == 0) + { + return text.Length; + } + + return indexes.Min(); + } + + private static string SkipUsings(string document) + { + // we cannot simply look for the last using since it can be used inside the code + // so we look for the last using before namespace + var namespaceIndex = document.IndexOf("namespace "); + var startIndex = 0; + var lastUsingIndex = 0; + + while (startIndex < namespaceIndex && startIndex++ != -1) + { + lastUsingIndex = startIndex; + startIndex = document.IndexOf("using ", startIndex); + } + + var afterUsingIndex = document.IndexOf($"{Environment.NewLine}", lastUsingIndex) + 1; + return document.Substring(afterUsingIndex).TrimStart(); + } + + private static IEnumerable SplitLines(string text) + { + var separator = new string[] { Environment.NewLine }; - return docStart.IndexOf(commentSyntaxEnd) + commentSyntaxEnd.Length - nbNewLines; + return text.Split(separator, StringSplitOptions.None); } } } \ No newline at end of file diff --git a/CodeMaid/Logic/Cleaning/FileHeaderLogic.cs b/CodeMaid/Logic/Cleaning/FileHeaderLogic.cs index 52527cece..eed68ebd3 100644 --- a/CodeMaid/Logic/Cleaning/FileHeaderLogic.cs +++ b/CodeMaid/Logic/Cleaning/FileHeaderLogic.cs @@ -3,6 +3,8 @@ using SteveCadwallader.CodeMaid.Properties; using SteveCadwallader.CodeMaid.UI.Enumerations; using System; +using System.Collections.Generic; +using System.ComponentModel; namespace SteveCadwallader.CodeMaid.Logic.Cleaning { @@ -61,6 +63,11 @@ internal void UpdateFileHeader(TextDocument textDocument) return; } + if (!settingsFileHeader.EndsWith(Environment.NewLine)) + { + settingsFileHeader += Environment.NewLine; + } + switch ((HeaderUpdateMode)Settings.Default.Cleaning_UpdateFileHeader_HeaderUpdateMode) { case HeaderUpdateMode.Insert: @@ -70,18 +77,98 @@ internal void UpdateFileHeader(TextDocument textDocument) case HeaderUpdateMode.Replace: ReplaceFileHeader(textDocument, settingsFileHeader); break; + + default: + throw new InvalidEnumArgumentException("Invalid file header update mode retrieved from settings"); } } + private int GetHeaderLength(TextDocument textDocument, bool skipUsings) + { + var headerBlock = ReadTextBlock(textDocument); + var language = textDocument.GetCodeLanguage(); + + return FileHeaderHelper.GetHeaderLength(language, headerBlock, skipUsings); + } + + private string GetCurrentHeader(TextDocument textDocument, bool skipUsings) + { + Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); + + var currentHeaderLength = GetHeaderLength(textDocument, skipUsings); + + var headerBlockStart = textDocument.StartPoint.CreateEditPoint(); + + if (skipUsings) + { + var nbLinesToSkip = GetNbLinesToSkip(textDocument); + + headerBlockStart.MoveToLineAndOffset(nbLinesToSkip + 1, 1); + } + + return headerBlockStart.GetText(currentHeaderLength + 1).Trim(); + } + + private int GetNbLinesToSkip(TextDocument textDocument) + { + var docHeadBlock = ReadTextBlock(textDocument); + + return FileHeaderHelper.GetNbLinesToSkip("using ", docHeadBlock, new List { "namespace ", "[assembly:" }); + } + private void InsertFileHeader(TextDocument textDocument, string settingsFileHeader) { + switch (FileHeaderHelper.GetFileHeaderPositionFromSettings(textDocument)) + { + case HeaderPosition.DocumentStart: + InsertFileHeaderDocumentStart(textDocument, settingsFileHeader); + return; + + case HeaderPosition.AfterUsings: + InsertFileHeaderAfterUsings(textDocument, settingsFileHeader); + return; + + default: + throw new InvalidEnumArgumentException("Invalid file header position retrieved from settings"); + } + } + + /// + /// Inserts a file header located after the first block of "using" lines + /// + /// The document to update + /// The new file header read from the settings + /// Only valid for languages containing "using" directive + private void InsertFileHeaderAfterUsings(TextDocument textDocument, string settingsFileHeader) + { + Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); + + var currentHeader = GetCurrentHeader(textDocument, true).Trim(); + var newHeader = settingsFileHeader.Trim(); + + if (string.Equals(currentHeader, newHeader)) + { + return; + } + + var headerBlockStart = textDocument.StartPoint.CreateEditPoint(); + var nbLinesToSkip = GetNbLinesToSkip(textDocument); + + headerBlockStart.MoveToLineAndOffset(nbLinesToSkip + 1, 1); + + headerBlockStart.Insert(settingsFileHeader); + } + + private void InsertFileHeaderDocumentStart(TextDocument textDocument, string settingsFileHeader) + { + Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); + var cursor = textDocument.StartPoint.CreateEditPoint(); var existingFileHeader = cursor.GetText(settingsFileHeader.Length); if (!existingFileHeader.StartsWith(settingsFileHeader.TrimStart())) { cursor.Insert(settingsFileHeader); - cursor.Insert(Environment.NewLine); } } @@ -90,28 +177,77 @@ private void InsertFileHeader(TextDocument textDocument, string settingsFileHead /// /// The document to read /// A string representing the first lines of the document - private string ReadHeaderBlock(TextDocument textDocument) + private string ReadTextBlock(TextDocument textDocument) { - var headerNbLines = Math.Min(HeaderMaxNbLines, textDocument.EndPoint.Line); - var headerBlockStart = textDocument.StartPoint.CreateEditPoint(); + Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); - return headerBlockStart.GetLines(1, headerNbLines); + var maxNbLines = Math.Min(HeaderMaxNbLines, textDocument.EndPoint.Line); + var blockStart = textDocument.StartPoint.CreateEditPoint(); + + return blockStart.GetLines(1, maxNbLines); } private void ReplaceFileHeader(TextDocument textDocument, string settingsFileHeader) { - var headerBlock = ReadHeaderBlock(textDocument); - var currentHeaderLength = FileHeaderHelper.GetHeaderLength(textDocument.GetCodeLanguage(), headerBlock); - var currentHeader = headerBlock.Substring(0, currentHeaderLength + 1) + Environment.NewLine; - var newHeader = settingsFileHeader + Environment.NewLine; + switch (FileHeaderHelper.GetFileHeaderPositionFromSettings(textDocument)) + { + case HeaderPosition.DocumentStart: + ReplaceFileHeaderDocumentStart(textDocument, settingsFileHeader); + return; + + case HeaderPosition.AfterUsings: + ReplaceFileHeaderAfterUsings(textDocument, settingsFileHeader); + return; + + default: + throw new InvalidEnumArgumentException("Invalid file header position retrieved from settings"); + } + } + + /// + /// Updates the file header located after the first block of "using" lines + /// + /// The document to update + /// The new file header read from the settings + /// Only valid for languages containing "using" directive + private void ReplaceFileHeaderAfterUsings(TextDocument textDocument, string settingsFileHeader) + { + Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); + + var currentHeader = GetCurrentHeader(textDocument, true).Trim(); + var newHeader = settingsFileHeader.Trim(); + + if (string.Equals(currentHeader, newHeader)) + { + return; + } + + var headerBlockStart = textDocument.StartPoint.CreateEditPoint(); + var nbLinesToSkip = GetNbLinesToSkip(textDocument); + + headerBlockStart.MoveToLineAndOffset(nbLinesToSkip + 1, 1); + + var currentHeaderLength = GetHeaderLength(textDocument, true); + + headerBlockStart.ReplaceText(currentHeaderLength, settingsFileHeader, (int)vsEPReplaceTextOptions.vsEPReplaceTextKeepMarkers); + } + + private void ReplaceFileHeaderDocumentStart(TextDocument textDocument, string settingsFileHeader) + { + Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); + + var currentHeader = GetCurrentHeader(textDocument, false).Trim(); + var newHeader = settingsFileHeader.Trim(); if (string.Equals(currentHeader, newHeader)) { return; } - var docStart = textDocument.StartPoint.CreateEditPoint(); - docStart.ReplaceText(currentHeaderLength, newHeader, (int)vsEPReplaceTextOptions.vsEPReplaceTextKeepMarkers); + var headerBlockStart = textDocument.StartPoint.CreateEditPoint(); + var currentHeaderLength = GetHeaderLength(textDocument, false); + + headerBlockStart.ReplaceText(currentHeaderLength, settingsFileHeader, (int)vsEPReplaceTextOptions.vsEPReplaceTextKeepMarkers); } #endregion Methods diff --git a/CodeMaid/Properties/Settings.Designer.cs b/CodeMaid/Properties/Settings.Designer.cs index 644978405..57e0dc89d 100644 --- a/CodeMaid/Properties/Settings.Designer.cs +++ b/CodeMaid/Properties/Settings.Designer.cs @@ -2270,6 +2270,18 @@ public sealed partial class Settings : global::System.Configuration.ApplicationS this["Cleaning_InclusionExpression"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int Cleaning_UpdateFileHeader_HeaderPosition { + get { + return ((int)(this["Cleaning_UpdateFileHeader_HeaderPosition"])); + } + set { + this["Cleaning_UpdateFileHeader_HeaderPosition"] = value; + } + } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] diff --git a/CodeMaid/Properties/Settings.settings b/CodeMaid/Properties/Settings.settings index a67dd04aa..151b11adb 100644 --- a/CodeMaid/Properties/Settings.settings +++ b/CodeMaid/Properties/Settings.settings @@ -567,6 +567,9 @@ + + + diff --git a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateDataTemplate.xaml b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateDataTemplate.xaml index 7bdcea2b6..be35a2304 100644 --- a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateDataTemplate.xaml +++ b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateDataTemplate.xaml @@ -21,12 +21,24 @@ - - + + - + + + + + + + + + + + + + diff --git a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateViewModel.cs b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateViewModel.cs index 46facc25b..9a3efd2d2 100644 --- a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateViewModel.cs +++ b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningUpdateViewModel.cs @@ -22,6 +22,7 @@ public CleaningUpdateViewModel(CodeMaidPackage package, Settings activeSettings) { new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateAccessorsToBothBeSingleLineOrMultiLine, x => UpdateAccessorsToBothBeSingleLineOrMultiLine), new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateEndRegionDirectives, x => UpdateEndRegionDirectives), + new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateFileHeader_HeaderPosition, x => HeaderPosition), new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateFileHeader_HeaderUpdateMode, x => HeaderUpdateMode), new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateFileHeaderCPlusPlus, x => UpdateFileHeaderCPlusPlus), new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateFileHeaderCSharp, x => UpdateFileHeaderCSharp), @@ -39,7 +40,7 @@ public CleaningUpdateViewModel(CodeMaidPackage package, Settings activeSettings) new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateFileHeaderVB, x => UpdateFileHeaderVisualBasic), new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateFileHeaderXAML, x => UpdateFileHeaderXAML), new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateFileHeaderXML, x => UpdateFileHeaderXML), - new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateSingleLineMethods, x => UpdateSingleLineMethods) + new SettingToOptionMapping(x => ActiveSettings.Cleaning_UpdateSingleLineMethods, x => UpdateSingleLineMethods), }; } @@ -56,6 +57,19 @@ public CleaningUpdateViewModel(CodeMaidPackage package, Settings activeSettings) #region Options + /// + /// Gets or sets the position of the file header. + /// + public HeaderPosition HeaderPosition + { + get { return GetPropertyValue(); } + set { SetPropertyValue(value); } + } + + #endregion Overrides of OptionsPageViewModel + + #region Options + /// /// Gets or sets the position of the file header. /// diff --git a/CodeMaid/UI/Enumerations/HeaderPosition.cs b/CodeMaid/UI/Enumerations/HeaderPosition.cs new file mode 100644 index 000000000..62d2d71ae --- /dev/null +++ b/CodeMaid/UI/Enumerations/HeaderPosition.cs @@ -0,0 +1,8 @@ +namespace SteveCadwallader.CodeMaid.UI.Enumerations +{ + public enum HeaderPosition + { + DocumentStart = 0, + AfterUsings = 1, + } +} \ No newline at end of file diff --git a/CodeMaid/app.config b/CodeMaid/app.config index 001d77bac..4a5da6e02 100644 --- a/CodeMaid/app.config +++ b/CodeMaid/app.config @@ -573,6 +573,9 @@ + + + From 12d80bfccfa5e60c56602b02008b80cb4989190d Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sun, 18 Jul 2021 16:12:49 -0400 Subject: [PATCH 11/15] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b04e5a212..02dda7691 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ These changes have not been released to the Visual Studio marketplace, but (if c - [ ] Features - [x] [#778](https://github.com/codecadwallader/codemaid/pull/778) - Cleaning: Option to specify file inclusions by RegEx - thanks [Timo-Weike](https://github.com/Timo-Weike)! - [x] [#797](https://github.com/codecadwallader/codemaid/pull/797) - Cleaning: Option to replace existing file headers (vs. default insert) - thanks [lflender](https://github.com/lflender)! + - [x] [#815](https://github.com/codecadwallader/codemaid/pull/815) - Cleaning: Option to place file headers after C# using block - thanks [lflender](https://github.com/lflender)! - [ ] Fixes - [x] [#800](https://github.com/codecadwallader/codemaid/pull/800) - Reorganizing: Fix dialog showing literal newline characters From bdc7e20dca4471ac371ed4d4d592f35e89ddd61f Mon Sep 17 00:00:00 2001 From: lflender Date: Sun, 22 Aug 2021 15:49:06 +0200 Subject: [PATCH 12/15] Added an option to include access level in regions only for methods (#828) * File header update now replaces the file header if one is already present Fixing issues #790 #757 * Adding option to choose between Insert or Replace file header * Addressing PR comments * Added an option to update file headers after using blocks for C# * Fixed file header update crashing when replacing with a header not ending with newline * Added an option to include access level in regions only for methods Co-authored-by: lflender --- CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs | 2 +- CodeMaid/Properties/Resources.Designer.cs | 9 +++++++++ CodeMaid/Properties/Resources.en-US.resx | 13 ++++++++----- CodeMaid/Properties/Resources.resx | 3 +++ CodeMaid/Properties/Resources.zh-Hans.resx | 11 +++++++---- CodeMaid/Properties/Settings.Designer.cs | 14 +++++++++++++- CodeMaid/Properties/Settings.settings | 3 +++ .../ReorganizingRegionsDataTemplate.xaml | 1 + .../Reorganizing/ReorganizingRegionsViewModel.cs | 7 +++++++ CodeMaid/app.config | 4 ++++ 10 files changed, 56 insertions(+), 11 deletions(-) diff --git a/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs b/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs index ae4698e12..3da5e7c92 100644 --- a/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs +++ b/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs @@ -335,7 +335,7 @@ private CodeItemRegion ComposeRegionForCodeItem(BaseCodeItem codeItem) if (Settings.Default.Reorganizing_RegionsIncludeAccessLevel) { var element = codeItem as BaseCodeItemElement; - if (element != null) + if (element != null && (!Settings.Default.Reorganizing_RegionsIncludeAccessLevelForMethodsOnly || element is CodeItemMethod)) { var accessModifier = CodeElementHelper.GetAccessModifierKeyword(element.Access); if (accessModifier != null) diff --git a/CodeMaid/Properties/Resources.Designer.cs b/CodeMaid/Properties/Resources.Designer.cs index 00ec0636a..42072a352 100644 --- a/CodeMaid/Properties/Resources.Designer.cs +++ b/CodeMaid/Properties/Resources.Designer.cs @@ -1512,6 +1512,15 @@ public class Resources { } } + /// + /// Looks up a localized string similar to Only for methods. + /// + public static string OnlyForMethods { + get { + return ResourceManager.GetString("OnlyForMethods", resourceCulture); + } + } + /// /// Looks up a localized string similar to to be reset to their defaults?. /// diff --git a/CodeMaid/Properties/Resources.en-US.resx b/CodeMaid/Properties/Resources.en-US.resx index 478d2d37e..07ac49de2 100644 --- a/CodeMaid/Properties/Resources.en-US.resx +++ b/CodeMaid/Properties/Resources.en-US.resx @@ -20,13 +20,13 @@ this is my long stringthis is a comment Blue - [base64 mime encoded serialized .NET Framework object] - + [base64 mime encoded serialized .NET Framework object] + - [base64 mime encoded string representing a byte array form of the .NET Framework object] + [base64 mime encoded string representing a byte array form of the .NET Framework object] This is a comment - - + + There are any number of "resheader" rows that contain simple name/value pairs. @@ -929,4 +929,7 @@ Do you want to reorganize anyways (DANGEROUS)? Regular expressions that match path names to include or leave empty to include all files (ex: \.resx$ or \\lib\\ ) + + Only for methods + \ No newline at end of file diff --git a/CodeMaid/Properties/Resources.resx b/CodeMaid/Properties/Resources.resx index e80321d63..07ac49de2 100644 --- a/CodeMaid/Properties/Resources.resx +++ b/CodeMaid/Properties/Resources.resx @@ -929,4 +929,7 @@ Do you want to reorganize anyways (DANGEROUS)? Regular expressions that match path names to include or leave empty to include all files (ex: \.resx$ or \\lib\\ ) + + Only for methods + \ No newline at end of file diff --git a/CodeMaid/Properties/Resources.zh-Hans.resx b/CodeMaid/Properties/Resources.zh-Hans.resx index a603889ac..c1b416796 100644 --- a/CodeMaid/Properties/Resources.zh-Hans.resx +++ b/CodeMaid/Properties/Resources.zh-Hans.resx @@ -20,12 +20,12 @@ this is my long stringthis is a comment Blue - [base64 mime encoded serialized .NET Framework object] - + [base64 mime encoded serialized .NET Framework object] + - [base64 mime encoded string representing a byte array form of the .NET Framework object] + [base64 mime encoded string representing a byte array form of the .NET Framework object] This is a comment - + There are any number of "resheader" rows that contain simple name/value pairs. @@ -924,4 +924,7 @@ 您有挂起的更改。 是否要在继续之前保存它们? + + Only for methods (TBT) + \ No newline at end of file diff --git a/CodeMaid/Properties/Settings.Designer.cs b/CodeMaid/Properties/Settings.Designer.cs index 57e0dc89d..da4dd0cd9 100644 --- a/CodeMaid/Properties/Settings.Designer.cs +++ b/CodeMaid/Properties/Settings.Designer.cs @@ -2270,7 +2270,7 @@ public sealed partial class Settings : global::System.Configuration.ApplicationS this["Cleaning_InclusionExpression"] = value; } } - + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0")] @@ -2294,5 +2294,17 @@ public sealed partial class Settings : global::System.Configuration.ApplicationS this["Cleaning_UpdateFileHeader_HeaderUpdateMode"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool Reorganizing_RegionsIncludeAccessLevelForMethodsOnly { + get { + return ((bool)(this["Reorganizing_RegionsIncludeAccessLevelForMethodsOnly"])); + } + set { + this["Reorganizing_RegionsIncludeAccessLevelForMethodsOnly"] = value; + } + } } } diff --git a/CodeMaid/Properties/Settings.settings b/CodeMaid/Properties/Settings.settings index 151b11adb..cf5af9aa1 100644 --- a/CodeMaid/Properties/Settings.settings +++ b/CodeMaid/Properties/Settings.settings @@ -573,5 +573,8 @@ + + False + \ No newline at end of file diff --git a/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingRegionsDataTemplate.xaml b/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingRegionsDataTemplate.xaml index 863011489..2a57d5e5d 100644 --- a/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingRegionsDataTemplate.xaml +++ b/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingRegionsDataTemplate.xaml @@ -8,6 +8,7 @@ + diff --git a/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingRegionsViewModel.cs b/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingRegionsViewModel.cs index 07e88321d..7afbd2e68 100644 --- a/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingRegionsViewModel.cs +++ b/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingRegionsViewModel.cs @@ -20,6 +20,7 @@ public ReorganizingRegionsViewModel(CodeMaidPackage package, Settings activeSett Mappings = new SettingsToOptionsList(ActiveSettings, this) { new SettingToOptionMapping(x => ActiveSettings.Reorganizing_RegionsIncludeAccessLevel, x => IncludeAccessLevel), + new SettingToOptionMapping(x => ActiveSettings.Reorganizing_RegionsIncludeAccessLevelForMethodsOnly, x => IncludeAccessLevelForMethodsOnly), new SettingToOptionMapping(x => ActiveSettings.Reorganizing_RegionsInsertKeepEvenIfEmpty, x => InsertKeepEvenIfEmpty), new SettingToOptionMapping(x => ActiveSettings.Reorganizing_RegionsInsertNewRegions, x => InsertNewRegions), new SettingToOptionMapping(x => ActiveSettings.Reorganizing_RegionsRemoveExistingRegions, x => RemoveExistingRegions) @@ -48,6 +49,12 @@ public bool IncludeAccessLevel set { SetPropertyValue(value); } } + public bool IncludeAccessLevelForMethodsOnly + { + get { return GetPropertyValue(); } + set { SetPropertyValue(value); } + } + /// /// Gets or sets the flag indicating if regions should be inserted or kept even if they would be empty. /// diff --git a/CodeMaid/app.config b/CodeMaid/app.config index 4a5da6e02..49fa908ec 100644 --- a/CodeMaid/app.config +++ b/CodeMaid/app.config @@ -579,6 +579,10 @@ + + False + From 46b82ebc986ae18ccd6909fd72c199e1d903753e Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sun, 22 Aug 2021 09:50:43 -0400 Subject: [PATCH 13/15] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02dda7691..df8011b3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ These changes have not been released to the Visual Studio marketplace, but (if c - [x] [#778](https://github.com/codecadwallader/codemaid/pull/778) - Cleaning: Option to specify file inclusions by RegEx - thanks [Timo-Weike](https://github.com/Timo-Weike)! - [x] [#797](https://github.com/codecadwallader/codemaid/pull/797) - Cleaning: Option to replace existing file headers (vs. default insert) - thanks [lflender](https://github.com/lflender)! - [x] [#815](https://github.com/codecadwallader/codemaid/pull/815) - Cleaning: Option to place file headers after C# using block - thanks [lflender](https://github.com/lflender)! + - [x] [#828](https://github.com/codecadwallader/codemaid/pull/828) - Reorganizing: Option to include access levels in regions for methods only - thanks [lflender](https://github.com/lflender)! - [ ] Fixes - [x] [#800](https://github.com/codecadwallader/codemaid/pull/800) - Reorganizing: Fix dialog showing literal newline characters From 4b935945f6aa9d3d8a82fbb964d00009226ae4fd Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Fri, 5 Nov 2021 08:11:18 -0400 Subject: [PATCH 14/15] Add support for VS2022 (#853) * Update to PackageReference * Migrage to PackageReferences * Migrate to PackageReferences * Simplify references. * Remove duplicate reference * Add test adapters * Add reference to try to get unit tests to run * Remove unnecessary references * Add skeleton Shared projects * Move files from CodeMaid to CodeMaidShared * Migrate resources and settings to shared * Update copyright statement * Remove empty group * Add skeleton VS2022 project * Remove experimental add * Flesh out links into VS2022 project * Update VS2022 targets * Update RootNamespace This seemed to fix the Resources.resx from the shared project not being available at runtime. * Update BuildTools * Add GetExecutingAssembly prior to any InitializeComponent call for VS2022 * Remove all explicit binding paths since the assembly name varies for VS2022. * Replace usage of FindPattern/ReplacePattern with IFindService (#847) * Replace usage of FindPattern/ReplacePattern with IFindService * Fix replace logic * cleanup * more cleanup * fix NU1605 warnings * fix test project build error * Remove ThreadHelper.ThrowIfNotOnUIThread These prevent Spade from loading which uses asynchronous background parsing for performance. * Fix inverted calculation This looks like it is intending to get the relative line offset, however it was subtracting the line position from the start of the line resulting in a negative number. These should(tm) be inverted so that the start of the line is subtracted from the place on the line. * Dogfood code cleanup via VS2022 * Dogfood code cleanup with VS2022 * Fix threading exceptions when running Solution cleanup (#851) * CodeMaid on CodeMaid * Re-fix inverted calculation Same as * Delete IntegrationTests * Delete IntegrationTests.testsettings * Updates to v12.0 Includes dropping VS2017 support, package upgrades, etc. * Revert 16.0 UI references, still refer to them as 15.0 in latest Co-authored-by: Oleg Tkachenko --- CHANGELOG.md | 3 +- .../Cleaning/FileTypes/CPlusPlusTests.cs | 106 -- .../Cleaning/FileTypes/CSHTMLTests.cs | 106 -- .../Cleaning/FileTypes/CSSTests.cs | 106 -- .../Cleaning/FileTypes/CSharpTests.cs | 106 -- .../Cleaning/FileTypes/Data/CPlusPlus.cpp | 8 - .../Cleaning/FileTypes/Data/CSHTML.cshtml | 50 - .../Cleaning/FileTypes/Data/CSS.css | 3 - .../Cleaning/FileTypes/Data/CSharp.cs | 12 - .../FileTypes/Data/EverythingElse.txt | 1 - .../Cleaning/FileTypes/Data/FSharp.fs | 35 - .../Cleaning/FileTypes/Data/HTML.html | 11 - .../Cleaning/FileTypes/Data/JSON.json | 11 - .../Cleaning/FileTypes/Data/JavaScript.js | 19 - .../Cleaning/FileTypes/Data/LESS.less | 3 - .../Cleaning/FileTypes/Data/PHP.php | 40 - .../Cleaning/FileTypes/Data/PowerShell.ps1 | 3 - .../Cleaning/FileTypes/Data/R.R | 13 - .../Cleaning/FileTypes/Data/SCSS.scss | 2 - .../Cleaning/FileTypes/Data/TypeScript.js | 19 - .../Cleaning/FileTypes/Data/TypeScript.ts | 25 - .../Cleaning/FileTypes/Data/VisualBasic.vb | 30 - .../Cleaning/FileTypes/Data/XAML.xaml | 3 - .../Cleaning/FileTypes/Data/XML.xml | 6 - .../Cleaning/FileTypes/EverythingElseTests.cs | 106 -- .../Cleaning/FileTypes/FSharpTests.cs | 106 -- .../Cleaning/FileTypes/HTMLTests.cs | 106 -- .../Cleaning/FileTypes/JSONTests.cs | 106 -- .../Cleaning/FileTypes/JavaScriptTests.cs | 106 -- .../Cleaning/FileTypes/LESSTests.cs | 106 -- .../Cleaning/FileTypes/PHPTests.cs | 107 -- .../Cleaning/FileTypes/PowerShellTests.cs | 106 -- .../Cleaning/FileTypes/RTests.cs | 106 -- .../Cleaning/FileTypes/SCSSTests.cs | 106 -- .../Cleaning/FileTypes/TypeScriptTests.cs | 106 -- .../Cleaning/FileTypes/VisualBasicTests.cs | 106 -- .../Cleaning/FileTypes/XAMLTests.cs | 106 -- .../Cleaning/FileTypes/XMLTests.cs | 106 -- .../BlankLinePaddingAfterClassesTests.cs | 86 -- .../BlankLinePaddingAfterDelegatesTests.cs | 86 -- ...BlankLinePaddingAfterEndRegionTagsTests.cs | 86 -- .../BlankLinePaddingAfterEnumerationsTests.cs | 86 -- .../BlankLinePaddingAfterEventsTests.cs | 86 -- ...ankLinePaddingAfterFieldsMultiLineTests.cs | 86 -- .../BlankLinePaddingAfterInterfacesTests.cs | 86 -- .../BlankLinePaddingAfterMethodsTests.cs | 86 -- .../BlankLinePaddingAfterNamespacesTests.cs | 86 -- ...inePaddingAfterPropertiesMultiLineTests.cs | 86 -- ...nePaddingAfterPropertiesSingleLineTests.cs | 86 -- .../BlankLinePaddingAfterRegionTagsTests.cs | 86 -- .../BlankLinePaddingAfterStructsTests.cs | 86 -- ...nePaddingAfterUsingStatementBlocksTests.cs | 90 -- ...ankLinePaddingBeforeCaseStatementsTests.cs | 83 -- .../BlankLinePaddingBeforeClassesTests.cs | 86 -- .../BlankLinePaddingBeforeDelegatesTests.cs | 86 -- ...lankLinePaddingBeforeEndRegionTagsTests.cs | 86 -- ...BlankLinePaddingBeforeEnumerationsTests.cs | 86 -- .../BlankLinePaddingBeforeEventsTests.cs | 86 -- ...nkLinePaddingBeforeFieldsMultiLineTests.cs | 86 -- .../BlankLinePaddingBeforeInterfacesTests.cs | 86 -- .../BlankLinePaddingBeforeMethodsTests.cs | 86 -- .../BlankLinePaddingBeforeNamespacesTests.cs | 86 -- ...nePaddingBeforePropertiesMultiLineTests.cs | 86 -- ...ePaddingBeforePropertiesSingleLineTests.cs | 86 -- .../BlankLinePaddingBeforeRegionTagsTests.cs | 86 -- ...inePaddingBeforeSingleLineCommentsTests.cs | 83 -- .../BlankLinePaddingBeforeStructsTests.cs | 86 -- ...ePaddingBeforeUsingStatementBlocksTests.cs | 90 -- ...gBetweenMultiLinePropertyAccessorsTests.cs | 86 -- ...SpaceBeforeSelfClosingAngleBracketTests.cs | 83 -- .../Data/BlankLinePaddingAfterClasses.cs | 24 - .../BlankLinePaddingAfterClasses_Cleaned.cs | 29 - .../Data/BlankLinePaddingAfterDelegates.cs | 12 - .../BlankLinePaddingAfterDelegates_Cleaned.cs | 17 - .../BlankLinePaddingAfterEndRegionTags.cs | 14 - ...nkLinePaddingAfterEndRegionTags_Cleaned.cs | 17 - .../Data/BlankLinePaddingAfterEnumerations.cs | 15 - ...ankLinePaddingAfterEnumerations_Cleaned.cs | 18 - .../Data/BlankLinePaddingAfterEvents.cs | 12 - .../BlankLinePaddingAfterEvents_Cleaned.cs | 15 - .../BlankLinePaddingAfterFieldsMultiLine.cs | 19 - ...LinePaddingAfterFieldsMultiLine_Cleaned.cs | 22 - .../Data/BlankLinePaddingAfterInterfaces.cs | 24 - ...BlankLinePaddingAfterInterfaces_Cleaned.cs | 29 - .../Data/BlankLinePaddingAfterMethods.cs | 33 - .../BlankLinePaddingAfterMethods_Cleaned.cs | 39 - .../Data/BlankLinePaddingAfterNamespaces.cs | 21 - ...BlankLinePaddingAfterNamespaces_Cleaned.cs | 26 - ...lankLinePaddingAfterPropertiesMultiLine.cs | 20 - ...PaddingAfterPropertiesMultiLine_Cleaned.cs | 22 - ...ankLinePaddingAfterPropertiesSingleLine.cs | 14 - ...addingAfterPropertiesSingleLine_Cleaned.cs | 17 - .../Data/BlankLinePaddingAfterRegionTags.cs | 14 - ...BlankLinePaddingAfterRegionTags_Cleaned.cs | 18 - .../Data/BlankLinePaddingAfterStructs.cs | 24 - .../BlankLinePaddingAfterStructs_Cleaned.cs | 29 - ...ankLinePaddingAfterUsingStatementBlocks.cs | 12 - ...addingAfterUsingStatementBlocks_Cleaned.cs | 14 - .../BlankLinePaddingBeforeCaseStatements.cs | 47 - ...LinePaddingBeforeCaseStatements_Cleaned.cs | 52 - .../Data/BlankLinePaddingBeforeClasses.cs | 24 - .../BlankLinePaddingBeforeClasses_Cleaned.cs | 28 - .../Data/BlankLinePaddingBeforeDelegates.cs | 12 - ...BlankLinePaddingBeforeDelegates_Cleaned.cs | 16 - .../BlankLinePaddingBeforeEndRegionTags.cs | 14 - ...kLinePaddingBeforeEndRegionTags_Cleaned.cs | 18 - .../BlankLinePaddingBeforeEnumerations.cs | 15 - ...nkLinePaddingBeforeEnumerations_Cleaned.cs | 17 - .../Data/BlankLinePaddingBeforeEvents.cs | 12 - .../BlankLinePaddingBeforeEvents_Cleaned.cs | 14 - .../BlankLinePaddingBeforeFieldsMultiLine.cs | 19 - ...inePaddingBeforeFieldsMultiLine_Cleaned.cs | 22 - .../Data/BlankLinePaddingBeforeInterfaces.cs | 24 - ...lankLinePaddingBeforeInterfaces_Cleaned.cs | 28 - .../Data/BlankLinePaddingBeforeMethods.cs | 33 - .../BlankLinePaddingBeforeMethods_Cleaned.cs | 40 - .../Data/BlankLinePaddingBeforeNamespaces.cs | 21 - ...lankLinePaddingBeforeNamespaces_Cleaned.cs | 25 - ...ankLinePaddingBeforePropertiesMultiLine.cs | 20 - ...addingBeforePropertiesMultiLine_Cleaned.cs | 21 - ...nkLinePaddingBeforePropertiesSingleLine.cs | 14 - ...ddingBeforePropertiesSingleLine_Cleaned.cs | 16 - .../Data/BlankLinePaddingBeforeRegionTags.cs | 14 - ...lankLinePaddingBeforeRegionTags_Cleaned.cs | 17 - ...lankLinePaddingBeforeSingleLineComments.cs | 26 - ...PaddingBeforeSingleLineComments_Cleaned.cs | 28 - .../Data/BlankLinePaddingBeforeStructs.cs | 24 - .../BlankLinePaddingBeforeStructs_Cleaned.cs | 28 - ...nkLinePaddingBeforeUsingStatementBlocks.cs | 12 - ...ddingBeforeUsingStatementBlocks_Cleaned.cs | 14 - ...addingBetweenMultiLinePropertyAccessors.cs | 123 --- ...tweenMultiLinePropertyAccessors_Cleaned.cs | 127 --- ...lankSpaceBeforeSelfClosingAngleBracket.xml | 11 - ...eBeforeSelfClosingAngleBracket_Cleaned.xml | 11 - .../Data/ExplicitAccessModifiersOnClasses.cs | 30 - ...xplicitAccessModifiersOnClasses_Cleaned.cs | 30 - .../ExplicitAccessModifiersOnDelegates.cs | 15 - ...licitAccessModifiersOnDelegates_Cleaned.cs | 15 - .../ExplicitAccessModifiersOnEnumerations.cs | 37 - ...itAccessModifiersOnEnumerations_Cleaned.cs | 37 - .../Data/ExplicitAccessModifiersOnEvents.cs | 30 - ...ExplicitAccessModifiersOnEvents_Cleaned.cs | 30 - .../Data/ExplicitAccessModifiersOnFields.cs | 19 - ...ExplicitAccessModifiersOnFields_Cleaned.cs | 19 - .../ExplicitAccessModifiersOnInterfaces.cs | 29 - ...icitAccessModifiersOnInterfaces_Cleaned.cs | 29 - .../Data/ExplicitAccessModifiersOnMethods.cs | 51 - ...xplicitAccessModifiersOnMethods_Cleaned.cs | 51 - .../ExplicitAccessModifiersOnProperties.cs | 31 - ...icitAccessModifiersOnProperties_Cleaned.cs | 31 - .../Data/ExplicitAccessModifiersOnStructs.cs | 21 - ...xplicitAccessModifiersOnStructs_Cleaned.cs | 21 - .../Data/InsertEndOfFileTrailingNewLine.cs | 6 - .../InsertEndOfFileTrailingNewLine_Cleaned.cs | 6 - .../ExplicitAccessModifiersOnClassesTests.cs | 86 -- ...ExplicitAccessModifiersOnDelegatesTests.cs | 86 -- ...licitAccessModifiersOnEnumerationsTests.cs | 86 -- .../ExplicitAccessModifiersOnEventsTests.cs | 86 -- .../ExplicitAccessModifiersOnFieldsTests.cs | 86 -- ...xplicitAccessModifiersOnInterfacesTests.cs | 86 -- .../ExplicitAccessModifiersOnMethodsTests.cs | 86 -- ...xplicitAccessModifiersOnPropertiesTests.cs | 86 -- .../ExplicitAccessModifiersOnStructsTests.cs | 86 -- .../InsertEndOfFileTrailingNewLineTests.cs | 83 -- .../Remove/BlankLinesAfterAttributesTests.cs | 83 -- .../BlankLinesAfterOpeningBraceTests.cs | 83 -- .../Remove/BlankLinesAtBottomTests.cs | 83 -- .../Cleaning/Remove/BlankLinesAtTopTests.cs | 83 -- .../BlankLinesBeforeClosingBraceTests.cs | 83 -- .../Remove/BlankLinesBeforeClosingTagTests.cs | 83 -- ...BlankLinesBetweenChainedStatementsTests.cs | 83 -- ...ankSpacesBeforeClosingAngleBracketTests.cs | 83 -- .../Remove/Data/BlankLinesAfterAttributes.cs | 45 - .../Data/BlankLinesAfterAttributes_Cleaned.cs | 39 - .../Data/BlankLinesAfterOpeningBrace.cs | 23 - .../BlankLinesAfterOpeningBrace_Cleaned.cs | 15 - .../Remove/Data/BlankLinesAtBottom.cs | 8 - .../Remove/Data/BlankLinesAtBottom_Cleaned.cs | 6 - .../Cleaning/Remove/Data/BlankLinesAtTop.cs | 9 - .../Remove/Data/BlankLinesAtTop_Cleaned.cs | 6 - .../Data/BlankLinesBeforeClosingBrace.cs | 24 - .../BlankLinesBeforeClosingBrace_Cleaned.cs | 15 - .../Data/BlankLinesBeforeClosingTag.xml | 13 - .../BlankLinesBeforeClosingTag_Cleaned.xml | 7 - .../BlankLinesBetweenChainedStatements.cs | 80 -- ...nkLinesBetweenChainedStatements_Cleaned.cs | 71 -- .../BlankSpacesBeforeClosingAngleBracket.xml | 19 - ...pacesBeforeClosingAngleBracket_Cleaned.xml | 16 - .../Remove/Data/EndOfLineWhitespace.cs | 6 - .../Data/EndOfLineWhitespace_Cleaned.cs | 6 - .../Data/MultipleConsecutiveBlankLines.cs | 23 - .../MultipleConsecutiveBlankLines_Cleaned.cs | 14 - .../Cleaning/Remove/Data/RemoveAllRegions.cs | 66 -- .../Remove/Data/RemoveAllRegions_Cleaned.cs | 34 - .../Remove/Data/RemoveCurrentRegion.cs | 54 - .../Data/RemoveCurrentRegion_Cleaned.cs | 51 - .../Remove/Data/RemoveEmptyRegions.cs | 46 - .../Remove/Data/RemoveEmptyRegions_Cleaned.cs | 16 - .../Data/RemoveEndOfFileTrailingNewLine.cs | 6 - .../RemoveEndOfFileTrailingNewLine_Cleaned.cs | 6 - .../Remove/Data/RemoveSelectedRegions.cs | 54 - .../Data/RemoveSelectedRegions_Cleaned.cs | 40 - .../Remove/Data/RemoveSetOfRegions.cs | 54 - .../Remove/Data/RemoveSetOfRegions_Cleaned.cs | 48 - .../Remove/EndOfLineWhitespaceTests.cs | 83 -- .../MultipleConsecutiveBlankLinesTests.cs | 83 -- .../Cleaning/Remove/RemoveAllRegionsTests.cs | 69 -- .../Remove/RemoveCurrentRegionTests.cs | 73 -- .../Remove/RemoveEmptyRegionsTests.cs | 87 -- .../RemoveEndOfFileTrailingNewLineTests.cs | 83 -- .../Remove/RemoveSelectedRegionsTests.cs | 65 -- .../Remove/RemoveSetOfRegionsTests.cs | 72 -- ...ssorsToBothBeSingleLineOrMultiLineTests.cs | 88 -- .../AccessorsToBothBeSingleLineOrMultiLine.cs | 162 --- ...rsToBothBeSingleLineOrMultiLine_Cleaned.cs | 168 --- .../Update/Data/EndRegionDirectives.cs | 25 - .../Data/EndRegionDirectives_Cleaned.cs | 25 - .../Update/Data/FileHeaderCPlusPlus.cpp | 1 - .../Data/FileHeaderCPlusPlus_Cleaned.cpp | 6 - .../Cleaning/Update/Data/FileHeaderCSS.css | 3 - .../Update/Data/FileHeaderCSS_Cleaned.css | 4 - .../Cleaning/Update/Data/FileHeaderCSharp.cs | 6 - .../Update/Data/FileHeaderCsharp_Cleaned.cs | 11 - .../Cleaning/Update/Data/FileHeaderFSharp.fs | 35 - .../Update/Data/FileHeaderFSharp_Cleaned.fs | 36 - .../Cleaning/Update/Data/FileHeaderHTML.html | 9 - .../Update/Data/FileHeaderHTML_Cleaned.html | 11 - .../Cleaning/Update/Data/FileHeaderJSON.json | 1 - .../Update/Data/FileHeaderJSON_Cleaned.json | 2 - .../Update/Data/FileHeaderJavaScript.js | 19 - .../Data/FileHeaderJavaScript_Cleaned.js | 21 - .../Cleaning/Update/Data/FileHeaderLESS.less | 3 - .../Update/Data/FileHeaderLESS_Cleaned.less | 4 - .../Cleaning/Update/Data/FileHeaderPHP.php | 35 - .../Update/Data/FileHeaderPHP_Cleaned.php | 40 - .../Update/Data/FileHeaderPowerShell.ps1 | 3 - .../Data/FileHeaderPowerShell_Cleaned.ps1 | 4 - .../Cleaning/Update/Data/FileHeaderR.R | 3 - .../Update/Data/FileHeaderR_Cleaned.R | 4 - .../Cleaning/Update/Data/FileHeaderSCSS.scss | 2 - .../Update/Data/FileHeaderSCSS_Cleaned.scss | 3 - .../Update/Data/FileHeaderTypeScript.ts | 25 - .../Data/FileHeaderTypeScript_Cleaned.ts | 27 - .../Update/Data/FileHeaderVisualBasic.vb | 30 - .../Data/FileHeaderVisualBasic_Cleaned.vb | 32 - .../Cleaning/Update/Data/FileHeaderXAML.xaml | 3 - .../Update/Data/FileHeaderXAML_Cleaned.xaml | 4 - .../Cleaning/Update/Data/FileHeaderXML.xml | 5 - .../Update/Data/FileHeaderXML_Cleaned.xml | 6 - .../Cleaning/Update/Data/SingleLineMethods.cs | 20 - .../Update/Data/SingleLineMethods_Cleaned.cs | 28 - .../Update/EndRegionDirectivesTests.cs | 83 -- .../Update/FileHeaderCPlusPlusTests.cs | 93 -- .../Cleaning/Update/FileHeaderCSSTests.cs | 83 -- .../Cleaning/Update/FileHeaderCSharpTests.cs | 93 -- .../Cleaning/Update/FileHeaderFSharpTests.cs | 83 -- .../Cleaning/Update/FileHeaderHTMLTests.cs | 87 -- .../Cleaning/Update/FileHeaderJSONTests.cs | 83 -- .../Update/FileHeaderJavaScriptTests.cs | 87 -- .../Cleaning/Update/FileHeaderLESSTests.cs | 83 -- .../Cleaning/Update/FileHeaderPHPTests.cs | 92 -- .../Update/FileHeaderPowerShellTests.cs | 83 -- .../Cleaning/Update/FileHeaderRTests.cs | 83 -- .../Cleaning/Update/FileHeaderSCSSTests.cs | 83 -- .../Update/FileHeaderTypeScriptTests.cs | 87 -- .../Update/FileHeaderVisualBasicTests.cs | 87 -- .../Cleaning/Update/FileHeaderXAMLTests.cs | 83 -- .../Cleaning/Update/FileHeaderXMLTests.cs | 83 -- .../Cleaning/Update/SingleLineMethodsTests.cs | 86 -- ...einsertAfterRemoveUnusedUsingStatements.cs | 9 - ...fterRemoveUnusedUsingStatements_Cleaned.cs | 5 - .../Data/RemoveAndSortUsingStatements.cs | 14 - .../RemoveAndSortUsingStatements_Cleaned.cs | 11 - ...rtAfterRemoveUnusedUsingStatementsTests.cs | 75 -- .../RemoveAndSortUsingStatementsTests.cs | 82 -- .../CodeMaid.IntegrationTests.csproj | 984 ------------------ CodeMaid.IntegrationTests/DialogTests.cs | 56 - .../Formatting/BaseCommentFormatTests.cs | 76 -- .../Formatting/Data/StandardCommentFormat.cs | 41 - .../Data/StandardCommentFormat_Formatted.cs | 43 - .../Formatting/Data/StyleCopHeaderFormat.cs | 14 - .../Data/StyleCopHeaderFormat_Formatted.cs | 17 - .../Formatting/Data/XMLCommentFormat.cs | 62 -- .../Data/XMLCommentFormat_Formatted.cs | 83 -- .../Formatting/StandardCommentFormatTests.cs | 62 -- .../Formatting/StylecopHeaderFormatTests.cs | 62 -- .../Formatting/XMLCommentFormatTests.cs | 62 -- .../Helpers/DialogBoxPurger.cs | 374 ------- .../Helpers/NativeMethods.cs | 151 --- .../Helpers/TestEnvironment.cs | 142 --- .../Helpers/TestOperations.cs | 115 -- .../Helpers/TestUtils.cs | 416 -------- CodeMaid.IntegrationTests/PackageTests.cs | 30 - .../Properties/AssemblyInfo.cs | 3 - .../Data/RegionsInsertAfterReorder.cs | 19 - .../RegionsInsertAfterReorder_Reorganized.cs | 26 - .../Data/RegionsInsertEvenIfEmpty.cs | 65 -- .../RegionsInsertEvenIfEmptyWithEmptyClass.cs | 8 - ...rtEvenIfEmptyWithEmptyClass_Reorganized.cs | 55 - ...RegionsInsertEvenIfEmptyWithEmptyRegion.cs | 11 - ...tEvenIfEmptyWithEmptyRegion_Reorganized.cs | 55 - .../RegionsInsertEvenIfEmpty_Reorganized.cs | 105 -- .../Data/RegionsInsertStandard.cs | 80 -- .../Data/RegionsInsertStandard_Reorganized.cs | 96 -- .../Data/RegionsInsertWithAccessModifiers.cs | 65 -- ...nsInsertWithAccessModifiers_Reorganized.cs | 109 -- .../Data/RegionsNewMemberOutside.cs | 39 - .../RegionsNewMemberOutside_Reorganized.cs | 40 - ...gionsRemoveAndInsertWithAccessModifiers.cs | 77 -- ...ndInsertWithAccessModifiers_Reorganized.cs | 78 -- ...nsRemoveAndInsertWithoutAccessModifiers.cs | 77 -- ...nsertWithoutAccessModifiers_Reorganized.cs | 74 -- .../Data/RegionsRemoveExisting.cs | 84 -- .../Data/RegionsRemoveExisting_Reorganized.cs | 69 -- .../Data/ReorganizationAvailability.cs | 29 - .../Reorganizing/Data/TypeCustomGrouping.cs | 221 ---- .../Data/TypeCustomGrouping_Reorganized.cs | 220 ---- .../Reorganizing/Data/TypeCustomOrder.cs | 221 ---- .../Data/TypeCustomOrder_Reorganized.cs | 212 ---- .../Reorganizing/Data/TypeDefaultOrder.cs | 209 ---- .../Data/TypeDefaultOrder_Reorganized.cs | 197 ---- .../RegionsInsertAfterReorderTests.cs | 72 -- .../RegionsInsertEvenIfEmptyTests.cs | 84 -- ...onsInsertEvenIfEmptyWithEmptyClassTests.cs | 84 -- ...nsInsertEvenIfEmptyWithEmptyRegionTests.cs | 84 -- .../RegionsInsertStandardTests.cs | 81 -- .../RegionsInsertWithAccessModifiersTests.cs | 84 -- .../RegionsNewMemberOutsideTests.cs | 65 -- ...RemoveAndInsertWithAccessModifiersTests.cs | 65 -- ...oveAndInsertWithoutAccessModifiersTests.cs | 65 -- .../RegionsRemoveExistingTests.cs | 81 -- .../ReorganizationAvailabilityTests.cs | 60 -- .../Reorganizing/TypeCustomGroupingTests.cs | 81 -- .../Reorganizing/TypeCustomOrderTests.cs | 81 -- .../Reorganizing/TypeDefaultOrderTests.cs | 67 -- .../Sorting/Data/SortAtBottom.cs | 11 - .../Sorting/Data/SortAtBottom_Sorted.cs | 11 - .../Sorting/Data/SortAtTop.cs | 11 - .../Sorting/Data/SortAtTop_Sorted.cs | 11 - .../Sorting/Data/SortNoChange.cs | 4 - .../Sorting/SortAtBottomTests.cs | 64 -- .../Sorting/SortAtTopTests.cs | 64 -- .../Sorting/SortNoChangeTests.cs | 56 - CodeMaid.IntegrationTests/ToolWindowTests.cs | 38 - CodeMaid.IntegrationTests/app.config | 26 - CodeMaid.IntegrationTests/packages.config | 33 - CodeMaid.UnitTests/CodeMaid.UnitTests.csproj | 60 +- .../Formatting/FormatWithPrefixTests.cs | 4 +- .../Helpers/FileHeaderHelperTests.cs | 8 +- CodeMaid.UnitTests/packages.config | 10 - CodeMaid.VS2022/CodeMaid.VS2022.csproj | 752 +++++++++++++ CodeMaid.VS2022/Properties/AssemblyInfo.cs | 3 + CodeMaid.VS2022/source.extension.cs | 13 + CodeMaid.VS2022/source.extension.en-US.resx | 130 +++ CodeMaid.VS2022/source.extension.ico | Bin 0 -> 835 bytes CodeMaid.VS2022/source.extension.resx | 130 +++ CodeMaid.VS2022/source.extension.vsixmanifest | 27 + CodeMaid.VS2022/source.extension.zh-Hans.resx | 130 +++ CodeMaid.sln | 27 +- CodeMaid/CodeMaid.csproj | 582 +---------- CodeMaid/CodeMaid.imagemanifest | 2 +- CodeMaid/Helpers/TextDocumentHelper.cs | 316 ------ CodeMaid/packages.config | 40 - CodeMaid/source.extension.vsixmanifest | 6 +- .../CodeMaidPackage.cs | 7 + CodeMaidShared/CodeMaidShared.projitems | 386 +++++++ CodeMaidShared/CodeMaidShared.shproj | 13 + .../Helpers/ActiveDocumentRestorer.cs | 0 .../Helpers/CachedSetting.cs | 0 .../Helpers/CachedSettingSet.cs | 0 .../Helpers/CodeCommentHelper.cs | 3 - .../Helpers/CodeElementHelper.cs | 0 .../Helpers/CodeItemNameComparer.cs | 0 .../Helpers/CodeItemParentExtensions.cs | 0 .../Helpers/CodeItemTypeComparer.cs | 0 .../Helpers/CodeLanguage.cs | 0 .../Helpers/CodeLanguageHelper.cs | 0 .../Helpers/CodeMaidSettingsProvider.cs | 0 .../Helpers/CommandHelper.cs | 0 .../Helpers/CursorPositionRestorer.cs | 0 .../Helpers/DocumentExtensions.cs | 0 .../Helpers/EditPointExtensions.cs | 0 .../Helpers/EnumHelper.cs | 0 .../ExplicitInterfaceImplementationHelper.cs | 0 .../Helpers/FileHeaderHelper.cs | 0 .../Helpers/MemberTypeSetting.cs | 0 .../Helpers/MemberTypeSettingHelper.cs | 0 .../Helpers/OutputWindowHelper.cs | 0 .../Helpers/ProjectItemExtensions.cs | 0 .../Helpers/PropertyInfoHelper.cs | 0 .../Helpers/RegexNullSafe.cs | 0 .../Helpers/RegionHelper.cs | 0 .../Helpers/SettingsContextHelper.cs | 0 .../Helpers/SettingsMonitor.cs | 0 .../Helpers/SolutionHelper.cs | 0 .../Helpers/TextDocumentExtensions.cs | 0 CodeMaidShared/Helpers/TextDocumentHelper.cs | 483 +++++++++ .../Helpers/TypeFormatHelper.cs | 0 .../Helpers/UIHierarchyHelper.cs | 0 .../Helpers/UndoTransactionHelper.cs | 0 .../Integration/Commands/AboutCommand.cs | 0 .../Integration/Commands/BaseCommand.cs | 0 .../BuildProgressToolWindowCommand.cs | 0 .../Commands/CleanupActiveCodeCommand.cs | 0 .../Commands/CleanupAllCodeCommand.cs | 0 .../Commands/CleanupOpenCodeCommand.cs | 0 .../Commands/CleanupSelectedCodeCommand.cs | 0 .../Commands/CloseAllReadOnlyCommand.cs | 0 .../CollapseAllSolutionExplorerCommand.cs | 0 ...CollapseSelectedSolutionExplorerCommand.cs | 0 .../Commands/CommentFormatCommand.cs | 0 .../Commands/FindInSolutionExplorerCommand.cs | 0 .../Integration/Commands/JoinLinesCommand.cs | 0 .../Integration/Commands/OptionsCommand.cs | 0 .../Commands/ReadOnlyToggleCommand.cs | 0 .../Commands/RemoveRegionCommand.cs | 0 .../Commands/ReorganizeActiveCodeCommand.cs | 0 .../Commands/SettingCleanupOnSaveCommand.cs | 0 .../Integration/Commands/SortLinesCommand.cs | 0 .../Commands/SpadeContextDeleteCommand.cs | 0 .../SpadeContextFindReferencesCommand.cs | 0 .../SpadeContextInsertRegionCommand.cs | 0 .../SpadeContextRemoveRegionCommand.cs | 0 .../Commands/SpadeOptionsCommand.cs | 0 .../Commands/SpadeRefreshCommand.cs | 0 .../Commands/SpadeSearchCommand.cs | 0 .../Commands/SpadeSortOrderAlphaCommand.cs | 0 .../Commands/SpadeSortOrderFileCommand.cs | 0 .../Commands/SpadeSortOrderTypeCommand.cs | 0 .../Commands/SpadeToolWindowCommand.cs | 0 .../Integration/Commands/SwitchFileCommand.cs | 0 .../Integration/Events/BaseEventListener.cs | 0 .../Events/BuildProgressEventListener.cs | 0 .../Events/DocumentEventListener.cs | 0 .../RunningDocumentTableEventListener.cs | 0 .../Events/SolutionEventListener.cs | 0 .../Events/TextEditorEventListener.cs | 0 .../Integration/Events/WindowEventListener.cs | 0 .../Integration/ISwitchableFeature.cs | 0 .../Cleaning/CodeCleanupAvailabilityLogic.cs | 0 .../Logic/Cleaning/CodeCleanupManager.cs | 0 .../Logic/Cleaning/FileHeaderLogic.cs | 0 .../Cleaning/InsertBlankLinePaddingLogic.cs | 0 .../InsertExplicitAccessModifierLogic.cs | 0 .../Logic/Cleaning/InsertWhitespaceLogic.cs | 0 .../Logic/Cleaning/RemoveRegionLogic.cs | 0 .../Logic/Cleaning/RemoveWhitespaceLogic.cs | 0 .../Logic/Cleaning/UpdateLogic.cs | 3 +- .../Cleaning/UsingStatementCleanupLogic.cs | 9 +- .../OutliningSynchronizationManager.cs | 0 .../Logic/Formatting/CommentFormatLogic.cs | 0 .../CodeReorganizationAvailabilityLogic.cs | 0 .../Reorganizing/CodeReorganizationManager.cs | 0 .../Logic/Reorganizing/GenerateRegionLogic.cs | 0 .../Reorganizing/RegionComparerByName.cs | 0 .../Model/CodeItems/BaseCodeItem.cs | 0 .../Model/CodeItems/BaseCodeItemElement.cs | 0 .../CodeItems/BaseCodeItemElementParent.cs | 0 .../Model/CodeItems/CodeItemClass.cs | 0 .../Model/CodeItems/CodeItemDelegate.cs | 0 .../Model/CodeItems/CodeItemEnum.cs | 0 .../Model/CodeItems/CodeItemEvent.cs | 0 .../Model/CodeItems/CodeItemField.cs | 0 .../Model/CodeItems/CodeItemInterface.cs | 0 .../Model/CodeItems/CodeItemMethod.cs | 0 .../Model/CodeItems/CodeItemNamespace.cs | 0 .../Model/CodeItems/CodeItemProperty.cs | 0 .../Model/CodeItems/CodeItemRegion.cs | 0 .../Model/CodeItems/CodeItemStruct.cs | 0 .../Model/CodeItems/CodeItemUsingStatement.cs | 0 .../Model/CodeItems/FactoryCodeItems.cs | 0 .../Model/CodeItems/ICodeItem.cs | 0 .../Model/CodeItems/ICodeItemComplexity.cs | 0 .../Model/CodeItems/ICodeItemParameters.cs | 0 .../Model/CodeItems/ICodeItemParent.cs | 0 .../Model/CodeItems/IInterfaceItem.cs | 0 .../Model/CodeItems/KindCodeItem.cs | 0 .../Model/CodeItems/SetCodeItems.cs | 0 .../Model/CodeItems/SnapshotCodeItems.cs | 0 .../Model/CodeModel.cs | 0 .../Model/CodeModelBuilder.cs | 0 .../Model/CodeModelCache.cs | 0 .../Model/CodeModelHelper.cs | 0 .../Model/CodeModelManager.cs | 0 .../Model/CodeTree/CodeSortOrder.cs | 0 .../Model/CodeTree/CodeTreeBuilder.cs | 0 .../Model/CodeTree/CodeTreeBuilderAsync.cs | 0 .../Model/CodeTree/CodeTreeRequest.cs | 0 .../Model/Comments/CodeComment.cs | 0 .../Model/Comments/CommentFormatter.cs | 0 .../Model/Comments/CommentLine.cs | 0 .../Model/Comments/CommentLineXml.cs | 0 .../Model/Comments/CommentMatch.cs | 0 .../Model/Comments/ICommentLine.cs | 0 .../Model/Comments/Options/CommentOptions.cs | 0 .../Comments/Options/FormatterOptions.cs | 0 .../Comments/Options/FormatterOptionsXml.cs | 0 .../Options/FormatterOptionsXmlTag.cs | 0 .../Model/Comments/Options/IXmlTagOptions.cs | 0 .../Model/Comments/Options/XmlTagCase.cs | 0 .../Model/Comments/Options/XmlTagNewLine.cs | 0 .../Model/Comments/Options/XmlTagOptions.cs | 0 .../Properties/Resources.Designer.cs | 0 .../Properties/Resources.en-US.resx | 0 .../Properties/Resources.resx | 0 .../Properties/Resources.zh-Hans.resx | 0 .../Properties/Settings.Designer.cs | 0 .../Properties/Settings.cs | 0 .../Properties/Settings.settings | 0 {CodeMaid => CodeMaidShared}/UI/Bindable.cs | 0 .../UI/Converters/BooleanInverseConverter.cs | 0 .../BooleanToVisibilityConverter.cs | 0 ...odeItemParentHighestComplexityConverter.cs | 0 .../CodeItemParentMemberCountConverter.cs | 0 .../UI/Converters/CodeItemToImageConverter.cs | 2 +- .../CodeItemToMetadataStringConverter.cs | 0 .../Converters/DocCommentToStringConverter.cs | 0 .../UI/Converters/EnumDescriptionConverter.cs | 0 .../UI/Converters/EnumToBooleanConverter.cs | 0 .../UI/Converters/IntToThicknessConverter.cs | 0 .../IsGreaterThanOrEqualToConverter.cs | 0 .../NameParametersToTextBlockConverter.cs | 0 .../UI/Converters/NullToBooleanConverter.cs | 0 .../PropertyInfoDescriptionConverter.cs | 0 .../UI/Converters/StringReplaceConverter.cs | 0 .../UI/Converters/TypeStringConverter.cs | 0 .../UI/DelegateCommand.cs | 0 .../UI/DependencyObjectExtensions.cs | 0 .../UI/Dialogs/About/AboutWindow.xaml | 4 +- .../UI/Dialogs/About/AboutWindow.xaml.cs | 3 + .../CleanupProgressViewModel.cs | 0 .../CleanupProgressWindow.xaml | 4 +- .../CleanupProgressWindow.xaml.cs | 4 + .../CleaningFileTypesDataTemplate.xaml | 0 .../Cleaning/CleaningFileTypesViewModel.cs | 0 .../Cleaning/CleaningGeneralDataTemplate.xaml | 0 .../Cleaning/CleaningGeneralViewModel.cs | 0 .../Cleaning/CleaningInsertDataTemplate.xaml | 0 .../Cleaning/CleaningInsertViewModel.cs | 0 .../Cleaning/CleaningParentDataTemplate.xaml | 0 .../Cleaning/CleaningParentViewModel.cs | 0 .../Cleaning/CleaningRemoveDataTemplate.xaml | 0 .../Cleaning/CleaningRemoveViewModel.cs | 0 .../Cleaning/CleaningUpdateDataTemplate.xaml | 0 .../Cleaning/CleaningUpdateViewModel.cs | 0 .../CleaningVisualStudioDataTemplate.xaml | 0 .../Cleaning/CleaningVisualStudioViewModel.cs | 0 .../Collapsing/CollapsingDataTemplate.xaml | 0 .../Options/Collapsing/CollapsingViewModel.cs | 0 .../Options/Digging/DiggingDataTemplate.xaml | 0 .../Options/Digging/DiggingViewModel.cs | 0 .../Options/Finding/FindingDataTemplate.xaml | 0 .../Options/Finding/FindingViewModel.cs | 0 .../Formatting/FormattingDataTemplate.xaml | 0 .../Options/Formatting/FormattingViewModel.cs | 0 .../Options/General/FeaturesDataTemplate.xaml | 0 .../Options/General/FeaturesViewModel.cs | 0 .../Options/General/GeneralDataTemplate.xaml | 84 +- .../Options/General/GeneralViewModel.cs | 0 .../Options/ISettingToOptionMapping.cs | 0 .../Dialogs/Options/OptionsPageViewModel.cs | 0 ...ptionsPageViewModelEnumerableExtensions.cs | 0 .../UI/Dialogs/Options/OptionsViewModel.cs | 0 .../UI/Dialogs/Options/OptionsWindow.xaml | 4 +- .../UI/Dialogs/Options/OptionsWindow.xaml.cs | 5 + .../Progressing/ProgressingDataTemplate.xaml | 0 .../Progressing/ProgressingViewModel.cs | 0 .../ReorganizingGeneralDataTemplate.xaml | 0 .../ReorganizingGeneralViewModel.cs | 0 .../ReorganizingParentDataTemplate.xaml | 0 .../ReorganizingParentViewModel.cs | 0 .../ReorganizingRegionsDataTemplate.xaml | 0 .../ReorganizingRegionsViewModel.cs | 0 .../ReorganizingTypesDataTemplate.xaml | 0 .../ReorganizingTypesViewModel.cs | 0 .../Dialogs/Options/SettingToOptionMapping.cs | 0 .../Dialogs/Options/SettingsToOptionsList.cs | 0 .../Switching/SwitchingDataTemplate.xaml | 0 .../Options/Switching/SwitchingViewModel.cs | 0 .../ThirdParty/ThirdPartyDataTemplate.xaml | 0 .../Options/ThirdParty/ThirdPartyViewModel.cs | 0 .../Dialogs/Prompts/YesNoPromptViewModel.cs | 0 .../UI/Dialogs/Prompts/YesNoPromptWindow.xaml | 4 +- .../Dialogs/Prompts/YesNoPromptWindow.xaml.cs | 7 +- .../UI/DragDropAttachedProperties.cs | 0 .../UI/EditableTextBlock.xaml | 0 .../UI/EditableTextBlock.xaml.cs | 3 + .../UI/Enumerations/AskYesNo.cs | 0 .../UI/Enumerations/DropPosition.cs | 0 .../UI/Enumerations/HeaderPosition.cs | 0 .../UI/Enumerations/HeaderUpdateMode.cs | 0 .../UI/Enumerations/IconSetMode.cs | 0 .../UI/Enumerations/NoneEmptyAll.cs | 0 .../UI/Enumerations/ThemeMode.cs | 0 .../UI/ListBoxReorderBehavior.cs | 0 .../UI/NotifiesOnAttribute.cs | 0 .../UI/ThemeManager.cs | 2 +- .../UI/Themes/Buttons.xaml | 0 .../UI/Themes/CodeMaidCoreTheme.xaml | 0 .../UI/Themes/CodeMaidDarkTheme.xaml | 4 +- .../UI/Themes/CodeMaidLightTheme.xaml | 4 +- .../UI/Themes/Colors.xaml | 0 .../UI/Themes/TreeViews.xaml | 0 .../BuildProgress/BuildProgressToolWindow.cs | 0 .../BuildProgress/BuildProgressView.xaml | 0 .../BuildProgress/BuildProgressView.xaml.cs | 5 + .../BuildProgress/BuildProgressViewModel.cs | 0 .../UI/ToolWindows/Spade/CenterConverter.cs | 0 .../Spade/CodeItemBaseTemplates.xaml | 0 .../Spade/CodeItemTemplateSelector.cs | 0 .../ToolWindows/Spade/CodeItemTemplates.xaml | 0 .../Spade/CodeItemToolTipTemplateSelector.cs | 0 .../Spade/CodeItemToolTipTemplates.xaml | 0 .../UI/ToolWindows/Spade/MemberSearchTask.cs | 0 .../ToolWindows/Spade/RadialProgressBar.xaml | 2 +- .../Spade/RadialProgressBar.xaml.cs | 6 +- .../UI/ToolWindows/Spade/SpadeToolWindow.cs | 0 .../UI/ToolWindows/Spade/SpadeView.xaml | 2 +- .../UI/ToolWindows/Spade/SpadeView.xaml.cs | 3 + .../UI/ToolWindows/Spade/SpadeViewModel.cs | 0 .../TreeViewBindableSelectedItemBehavior.cs | 0 .../UI/TreeViewMultipleSelectionBehavior.cs | 0 .../UI/WindowAttachedProperties.cs | 0 {CodeMaid => CodeMaidShared}/app.config | 0 GlobalAssemblyInfo.cs | 2 +- ISSUE_TEMPLATE.md | 4 +- IntegrationTests.testsettings | 18 - README.md | 3 +- appveyor.yml | 4 +- 629 files changed, 2246 insertions(+), 20558 deletions(-) delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/CPlusPlusTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/CSHTMLTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/CSSTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/CSharpTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CPlusPlus.cpp delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CSHTML.cshtml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CSS.css delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CSharp.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/EverythingElse.txt delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/FSharp.fs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/HTML.html delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/JSON.json delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/JavaScript.js delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/LESS.less delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/PHP.php delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/PowerShell.ps1 delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/R.R delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/SCSS.scss delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/TypeScript.js delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/TypeScript.ts delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/VisualBasic.vb delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/XAML.xaml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/XML.xml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/EverythingElseTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/FSharpTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/HTMLTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/JSONTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/JavaScriptTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/LESSTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/PHPTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/PowerShellTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/RTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/SCSSTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/TypeScriptTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/VisualBasicTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/XAMLTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/FileTypes/XMLTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterClassesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterDelegatesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterEndRegionTagsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterEnumerationsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterEventsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterFieldsMultiLineTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterInterfacesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterMethodsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterNamespacesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterPropertiesMultiLineTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterPropertiesSingleLineTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterRegionTagsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterStructsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterUsingStatementBlocksTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeCaseStatementsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeClassesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeDelegatesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeEndRegionTagsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeEnumerationsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeEventsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeFieldsMultiLineTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeInterfacesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeMethodsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeNamespacesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforePropertiesMultiLineTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforePropertiesSingleLineTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeRegionTagsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeSingleLineCommentsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeStructsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeUsingStatementBlocksTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBetweenMultiLinePropertyAccessorsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/BlankSpaceBeforeSelfClosingAngleBracketTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterClasses.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterClasses_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterDelegates.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterDelegates_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEndRegionTags.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEndRegionTags_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEnumerations.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEnumerations_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEvents.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEvents_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterFieldsMultiLine.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterFieldsMultiLine_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterInterfaces.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterInterfaces_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterMethods.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterMethods_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterNamespaces.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterNamespaces_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesMultiLine.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesMultiLine_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesSingleLine.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesSingleLine_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterRegionTags.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterRegionTags_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterStructs.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterStructs_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterUsingStatementBlocks.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterUsingStatementBlocks_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeCaseStatements.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeCaseStatements_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeClasses.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeClasses_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeDelegates.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeDelegates_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEndRegionTags.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEndRegionTags_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEnumerations.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEnumerations_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEvents.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEvents_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeFieldsMultiLine.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeFieldsMultiLine_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeInterfaces.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeInterfaces_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeMethods.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeMethods_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeNamespaces.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeNamespaces_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesMultiLine.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesMultiLine_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesSingleLine.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesSingleLine_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeRegionTags.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeRegionTags_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeSingleLineComments.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeSingleLineComments_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeStructs.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeStructs_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeUsingStatementBlocks.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeUsingStatementBlocks_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBetweenMultiLinePropertyAccessors.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBetweenMultiLinePropertyAccessors_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankSpaceBeforeSelfClosingAngleBracket.xml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankSpaceBeforeSelfClosingAngleBracket_Cleaned.xml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnClasses.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnClasses_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnDelegates.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnDelegates_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEnumerations.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEnumerations_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEvents.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEvents_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnFields.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnFields_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnInterfaces.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnInterfaces_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnMethods.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnMethods_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnProperties.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnProperties_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnStructs.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnStructs_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/InsertEndOfFileTrailingNewLine.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/Data/InsertEndOfFileTrailingNewLine_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnClassesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnDelegatesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnEnumerationsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnEventsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnFieldsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnInterfacesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnMethodsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnPropertiesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnStructsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Insert/InsertEndOfFileTrailingNewLineTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAfterAttributesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAfterOpeningBraceTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAtBottomTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAtTopTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesBeforeClosingBraceTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesBeforeClosingTagTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesBetweenChainedStatementsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/BlankSpacesBeforeClosingAngleBracketTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterAttributes.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterAttributes_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterOpeningBrace.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterOpeningBrace_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtBottom.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtBottom_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtTop.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtTop_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingBrace.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingBrace_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingTag.xml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingTag_Cleaned.xml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBetweenChainedStatements.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBetweenChainedStatements_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankSpacesBeforeClosingAngleBracket.xml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankSpacesBeforeClosingAngleBracket_Cleaned.xml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/EndOfLineWhitespace.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/EndOfLineWhitespace_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/MultipleConsecutiveBlankLines.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/MultipleConsecutiveBlankLines_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveAllRegions.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveAllRegions_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveCurrentRegion.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveCurrentRegion_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEmptyRegions.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEmptyRegions_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEndOfFileTrailingNewLine.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEndOfFileTrailingNewLine_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSelectedRegions.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSelectedRegions_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSetOfRegions.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSetOfRegions_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/EndOfLineWhitespaceTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/MultipleConsecutiveBlankLinesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/RemoveAllRegionsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/RemoveCurrentRegionTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/RemoveEmptyRegionsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/RemoveEndOfFileTrailingNewLineTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/RemoveSelectedRegionsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Remove/RemoveSetOfRegionsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/AccessorsToBothBeSingleLineOrMultiLineTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/AccessorsToBothBeSingleLineOrMultiLine.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/AccessorsToBothBeSingleLineOrMultiLine_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/EndRegionDirectives.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/EndRegionDirectives_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCPlusPlus.cpp delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCPlusPlus_Cleaned.cpp delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCSS.css delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCSS_Cleaned.css delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCSharp.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCsharp_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderFSharp.fs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderFSharp_Cleaned.fs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderHTML.html delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderHTML_Cleaned.html delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJSON.json delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJSON_Cleaned.json delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJavaScript.js delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJavaScript_Cleaned.js delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderLESS.less delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderLESS_Cleaned.less delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPHP.php delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPHP_Cleaned.php delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPowerShell.ps1 delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPowerShell_Cleaned.ps1 delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderR.R delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderR_Cleaned.R delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderSCSS.scss delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderSCSS_Cleaned.scss delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderTypeScript.ts delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderTypeScript_Cleaned.ts delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderVisualBasic.vb delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderVisualBasic_Cleaned.vb delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXAML.xaml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXAML_Cleaned.xaml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXML.xml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXML_Cleaned.xml delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/SingleLineMethods.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/Data/SingleLineMethods_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/EndRegionDirectivesTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderCPlusPlusTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderCSSTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderCSharpTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderFSharpTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderHTMLTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderJSONTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderJavaScriptTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderLESSTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderPHPTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderPowerShellTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderRTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderSCSSTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderTypeScriptTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderVisualBasicTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderXAMLTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderXMLTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/Update/SingleLineMethodsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/ReinsertAfterRemoveUnusedUsingStatements.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/ReinsertAfterRemoveUnusedUsingStatements_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/ReinsertAfterRemoveUnusedUsingStatementsTests.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/RemoveAndSortUsingStatementsTests.cs delete mode 100644 CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj delete mode 100644 CodeMaid.IntegrationTests/DialogTests.cs delete mode 100644 CodeMaid.IntegrationTests/Formatting/BaseCommentFormatTests.cs delete mode 100644 CodeMaid.IntegrationTests/Formatting/Data/StandardCommentFormat.cs delete mode 100644 CodeMaid.IntegrationTests/Formatting/Data/StandardCommentFormat_Formatted.cs delete mode 100644 CodeMaid.IntegrationTests/Formatting/Data/StyleCopHeaderFormat.cs delete mode 100644 CodeMaid.IntegrationTests/Formatting/Data/StyleCopHeaderFormat_Formatted.cs delete mode 100644 CodeMaid.IntegrationTests/Formatting/Data/XMLCommentFormat.cs delete mode 100644 CodeMaid.IntegrationTests/Formatting/Data/XMLCommentFormat_Formatted.cs delete mode 100644 CodeMaid.IntegrationTests/Formatting/StandardCommentFormatTests.cs delete mode 100644 CodeMaid.IntegrationTests/Formatting/StylecopHeaderFormatTests.cs delete mode 100644 CodeMaid.IntegrationTests/Formatting/XMLCommentFormatTests.cs delete mode 100644 CodeMaid.IntegrationTests/Helpers/DialogBoxPurger.cs delete mode 100644 CodeMaid.IntegrationTests/Helpers/NativeMethods.cs delete mode 100644 CodeMaid.IntegrationTests/Helpers/TestEnvironment.cs delete mode 100644 CodeMaid.IntegrationTests/Helpers/TestOperations.cs delete mode 100644 CodeMaid.IntegrationTests/Helpers/TestUtils.cs delete mode 100644 CodeMaid.IntegrationTests/PackageTests.cs delete mode 100644 CodeMaid.IntegrationTests/Properties/AssemblyInfo.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertAfterReorder.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertAfterReorder_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmpty.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyClass.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyClass_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyRegion.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyRegion_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmpty_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertStandard.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertStandard_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertWithAccessModifiers.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertWithAccessModifiers_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsNewMemberOutside.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsNewMemberOutside_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithAccessModifiers.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithAccessModifiers_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithoutAccessModifiers.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithoutAccessModifiers_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveExisting.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveExisting_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/ReorganizationAvailability.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomGrouping.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomGrouping_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomOrder.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomOrder_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/TypeDefaultOrder.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/Data/TypeDefaultOrder_Reorganized.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/RegionsInsertAfterReorderTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/RegionsInsertEvenIfEmptyTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/RegionsInsertEvenIfEmptyWithEmptyClassTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/RegionsInsertEvenIfEmptyWithEmptyRegionTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/RegionsInsertStandardTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/RegionsInsertWithAccessModifiersTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/RegionsNewMemberOutsideTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/RegionsRemoveAndInsertWithAccessModifiersTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/RegionsRemoveAndInsertWithoutAccessModifiersTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/RegionsRemoveExistingTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/ReorganizationAvailabilityTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/TypeCustomGroupingTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/TypeCustomOrderTests.cs delete mode 100644 CodeMaid.IntegrationTests/Reorganizing/TypeDefaultOrderTests.cs delete mode 100644 CodeMaid.IntegrationTests/Sorting/Data/SortAtBottom.cs delete mode 100644 CodeMaid.IntegrationTests/Sorting/Data/SortAtBottom_Sorted.cs delete mode 100644 CodeMaid.IntegrationTests/Sorting/Data/SortAtTop.cs delete mode 100644 CodeMaid.IntegrationTests/Sorting/Data/SortAtTop_Sorted.cs delete mode 100644 CodeMaid.IntegrationTests/Sorting/Data/SortNoChange.cs delete mode 100644 CodeMaid.IntegrationTests/Sorting/SortAtBottomTests.cs delete mode 100644 CodeMaid.IntegrationTests/Sorting/SortAtTopTests.cs delete mode 100644 CodeMaid.IntegrationTests/Sorting/SortNoChangeTests.cs delete mode 100644 CodeMaid.IntegrationTests/ToolWindowTests.cs delete mode 100644 CodeMaid.IntegrationTests/app.config delete mode 100644 CodeMaid.IntegrationTests/packages.config delete mode 100644 CodeMaid.UnitTests/packages.config create mode 100644 CodeMaid.VS2022/CodeMaid.VS2022.csproj create mode 100644 CodeMaid.VS2022/Properties/AssemblyInfo.cs create mode 100644 CodeMaid.VS2022/source.extension.cs create mode 100644 CodeMaid.VS2022/source.extension.en-US.resx create mode 100644 CodeMaid.VS2022/source.extension.ico create mode 100644 CodeMaid.VS2022/source.extension.resx create mode 100644 CodeMaid.VS2022/source.extension.vsixmanifest create mode 100644 CodeMaid.VS2022/source.extension.zh-Hans.resx delete mode 100644 CodeMaid/Helpers/TextDocumentHelper.cs delete mode 100644 CodeMaid/packages.config rename {CodeMaid => CodeMaidShared}/CodeMaidPackage.cs (98%) create mode 100644 CodeMaidShared/CodeMaidShared.projitems create mode 100644 CodeMaidShared/CodeMaidShared.shproj rename {CodeMaid => CodeMaidShared}/Helpers/ActiveDocumentRestorer.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/CachedSetting.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/CachedSettingSet.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/CodeCommentHelper.cs (97%) rename {CodeMaid => CodeMaidShared}/Helpers/CodeElementHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/CodeItemNameComparer.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/CodeItemParentExtensions.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/CodeItemTypeComparer.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/CodeLanguage.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/CodeLanguageHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/CodeMaidSettingsProvider.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/CommandHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/CursorPositionRestorer.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/DocumentExtensions.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/EditPointExtensions.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/EnumHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/ExplicitInterfaceImplementationHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/FileHeaderHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/MemberTypeSetting.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/MemberTypeSettingHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/OutputWindowHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/ProjectItemExtensions.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/PropertyInfoHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/RegexNullSafe.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/RegionHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/SettingsContextHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/SettingsMonitor.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/SolutionHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/TextDocumentExtensions.cs (100%) create mode 100644 CodeMaidShared/Helpers/TextDocumentHelper.cs rename {CodeMaid => CodeMaidShared}/Helpers/TypeFormatHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/UIHierarchyHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Helpers/UndoTransactionHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/AboutCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/BaseCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/BuildProgressToolWindowCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/CleanupActiveCodeCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/CleanupAllCodeCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/CleanupOpenCodeCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/CleanupSelectedCodeCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/CloseAllReadOnlyCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/CollapseAllSolutionExplorerCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/CollapseSelectedSolutionExplorerCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/CommentFormatCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/FindInSolutionExplorerCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/JoinLinesCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/OptionsCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/ReadOnlyToggleCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/RemoveRegionCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/ReorganizeActiveCodeCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SettingCleanupOnSaveCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SortLinesCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SpadeContextDeleteCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SpadeContextFindReferencesCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SpadeContextInsertRegionCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SpadeContextRemoveRegionCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SpadeOptionsCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SpadeRefreshCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SpadeSearchCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SpadeSortOrderAlphaCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SpadeSortOrderFileCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SpadeSortOrderTypeCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SpadeToolWindowCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Commands/SwitchFileCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Events/BaseEventListener.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Events/BuildProgressEventListener.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Events/DocumentEventListener.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Events/RunningDocumentTableEventListener.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Events/SolutionEventListener.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Events/TextEditorEventListener.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/Events/WindowEventListener.cs (100%) rename {CodeMaid => CodeMaidShared}/Integration/ISwitchableFeature.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Cleaning/CodeCleanupManager.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Cleaning/FileHeaderLogic.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Cleaning/InsertBlankLinePaddingLogic.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Cleaning/InsertExplicitAccessModifierLogic.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Cleaning/InsertWhitespaceLogic.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Cleaning/RemoveRegionLogic.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Cleaning/RemoveWhitespaceLogic.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Cleaning/UpdateLogic.cs (98%) rename {CodeMaid => CodeMaidShared}/Logic/Cleaning/UsingStatementCleanupLogic.cs (93%) rename {CodeMaid => CodeMaidShared}/Logic/Digging/OutliningSynchronizationManager.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Formatting/CommentFormatLogic.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Reorganizing/CodeReorganizationManager.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Reorganizing/GenerateRegionLogic.cs (100%) rename {CodeMaid => CodeMaidShared}/Logic/Reorganizing/RegionComparerByName.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/BaseCodeItem.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/BaseCodeItemElement.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/BaseCodeItemElementParent.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/CodeItemClass.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/CodeItemDelegate.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/CodeItemEnum.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/CodeItemEvent.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/CodeItemField.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/CodeItemInterface.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/CodeItemMethod.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/CodeItemNamespace.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/CodeItemProperty.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/CodeItemRegion.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/CodeItemStruct.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/CodeItemUsingStatement.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/FactoryCodeItems.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/ICodeItem.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/ICodeItemComplexity.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/ICodeItemParameters.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/ICodeItemParent.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/IInterfaceItem.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/KindCodeItem.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/SetCodeItems.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeItems/SnapshotCodeItems.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeModel.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeModelBuilder.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeModelCache.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeModelHelper.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeModelManager.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeTree/CodeSortOrder.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeTree/CodeTreeBuilder.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeTree/CodeTreeBuilderAsync.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/CodeTree/CodeTreeRequest.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/CodeComment.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/CommentFormatter.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/CommentLine.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/CommentLineXml.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/CommentMatch.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/ICommentLine.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/Options/CommentOptions.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/Options/FormatterOptions.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/Options/FormatterOptionsXml.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/Options/FormatterOptionsXmlTag.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/Options/IXmlTagOptions.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/Options/XmlTagCase.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/Options/XmlTagNewLine.cs (100%) rename {CodeMaid => CodeMaidShared}/Model/Comments/Options/XmlTagOptions.cs (100%) rename {CodeMaid => CodeMaidShared}/Properties/Resources.Designer.cs (100%) rename {CodeMaid => CodeMaidShared}/Properties/Resources.en-US.resx (100%) rename {CodeMaid => CodeMaidShared}/Properties/Resources.resx (100%) rename {CodeMaid => CodeMaidShared}/Properties/Resources.zh-Hans.resx (100%) rename {CodeMaid => CodeMaidShared}/Properties/Settings.Designer.cs (100%) rename {CodeMaid => CodeMaidShared}/Properties/Settings.cs (100%) rename {CodeMaid => CodeMaidShared}/Properties/Settings.settings (100%) rename {CodeMaid => CodeMaidShared}/UI/Bindable.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/BooleanInverseConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/BooleanToVisibilityConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/CodeItemParentHighestComplexityConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/CodeItemParentMemberCountConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/CodeItemToImageConverter.cs (97%) rename {CodeMaid => CodeMaidShared}/UI/Converters/CodeItemToMetadataStringConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/DocCommentToStringConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/EnumDescriptionConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/EnumToBooleanConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/IntToThicknessConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/IsGreaterThanOrEqualToConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/NameParametersToTextBlockConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/NullToBooleanConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/PropertyInfoDescriptionConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/StringReplaceConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Converters/TypeStringConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/DelegateCommand.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/DependencyObjectExtensions.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/About/AboutWindow.xaml (94%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/About/AboutWindow.xaml.cs (97%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/CleanupProgress/CleanupProgressViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/CleanupProgress/CleanupProgressWindow.xaml (92%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/CleanupProgress/CleanupProgressWindow.xaml.cs (91%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningFileTypesDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningFileTypesViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningGeneralDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningGeneralViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningInsertDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningInsertViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningParentDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningParentViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningRemoveDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningRemoveViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningUpdateDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningUpdateViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningVisualStudioDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Cleaning/CleaningVisualStudioViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Collapsing/CollapsingDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Collapsing/CollapsingViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Digging/DiggingDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Digging/DiggingViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Finding/FindingDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Finding/FindingViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Formatting/FormattingDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Formatting/FormattingViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/General/FeaturesDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/General/FeaturesViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/General/GeneralDataTemplate.xaml (55%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/General/GeneralViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/ISettingToOptionMapping.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/OptionsPageViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/OptionsPageViewModelEnumerableExtensions.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/OptionsViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/OptionsWindow.xaml (98%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/OptionsWindow.xaml.cs (77%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Progressing/ProgressingDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Progressing/ProgressingViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Reorganizing/ReorganizingGeneralDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Reorganizing/ReorganizingGeneralViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Reorganizing/ReorganizingParentDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Reorganizing/ReorganizingParentViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Reorganizing/ReorganizingRegionsDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Reorganizing/ReorganizingRegionsViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Reorganizing/ReorganizingTypesDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Reorganizing/ReorganizingTypesViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/SettingToOptionMapping.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/SettingsToOptionsList.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Switching/SwitchingDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/Switching/SwitchingViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/ThirdParty/ThirdPartyDataTemplate.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Options/ThirdParty/ThirdPartyViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Prompts/YesNoPromptViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Prompts/YesNoPromptWindow.xaml (92%) rename {CodeMaid => CodeMaidShared}/UI/Dialogs/Prompts/YesNoPromptWindow.xaml.cs (66%) rename {CodeMaid => CodeMaidShared}/UI/DragDropAttachedProperties.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/EditableTextBlock.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/EditableTextBlock.xaml.cs (97%) rename {CodeMaid => CodeMaidShared}/UI/Enumerations/AskYesNo.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Enumerations/DropPosition.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Enumerations/HeaderPosition.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Enumerations/HeaderUpdateMode.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Enumerations/IconSetMode.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Enumerations/NoneEmptyAll.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/Enumerations/ThemeMode.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/ListBoxReorderBehavior.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/NotifiesOnAttribute.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/ThemeManager.cs (98%) rename {CodeMaid => CodeMaidShared}/UI/Themes/Buttons.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Themes/CodeMaidCoreTheme.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Themes/CodeMaidDarkTheme.xaml (74%) rename {CodeMaid => CodeMaidShared}/UI/Themes/CodeMaidLightTheme.xaml (74%) rename {CodeMaid => CodeMaidShared}/UI/Themes/Colors.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/Themes/TreeViews.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/BuildProgress/BuildProgressToolWindow.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/BuildProgress/BuildProgressView.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/BuildProgress/BuildProgressView.xaml.cs (77%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/BuildProgress/BuildProgressViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/CenterConverter.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/CodeItemBaseTemplates.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/CodeItemTemplateSelector.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/CodeItemTemplates.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/CodeItemToolTipTemplateSelector.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/CodeItemToolTipTemplates.xaml (100%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/MemberSearchTask.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/RadialProgressBar.xaml (98%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/RadialProgressBar.xaml.cs (57%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/SpadeToolWindow.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/SpadeView.xaml (99%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/SpadeView.xaml.cs (99%) rename {CodeMaid => CodeMaidShared}/UI/ToolWindows/Spade/SpadeViewModel.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/TreeViewBindableSelectedItemBehavior.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/TreeViewMultipleSelectionBehavior.cs (100%) rename {CodeMaid => CodeMaidShared}/UI/WindowAttachedProperties.cs (100%) rename {CodeMaid => CodeMaidShared}/app.config (100%) delete mode 100644 IntegrationTests.testsettings diff --git a/CHANGELOG.md b/CHANGELOG.md index df8011b3e..20614cbdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## vNext (11.3) +## vNext (12.0) These changes have not been released to the Visual Studio marketplace, but (if checked) are available in preview within the [CI build](http://vsixgallery.com/extension/4c82e17d-927e-42d2-8460-b473ac7df316/). @@ -9,6 +9,7 @@ These changes have not been released to the Visual Studio marketplace, but (if c - [x] [#797](https://github.com/codecadwallader/codemaid/pull/797) - Cleaning: Option to replace existing file headers (vs. default insert) - thanks [lflender](https://github.com/lflender)! - [x] [#815](https://github.com/codecadwallader/codemaid/pull/815) - Cleaning: Option to place file headers after C# using block - thanks [lflender](https://github.com/lflender)! - [x] [#828](https://github.com/codecadwallader/codemaid/pull/828) - Reorganizing: Option to include access levels in regions for methods only - thanks [lflender](https://github.com/lflender)! + - [x] [#853](https://github.com/codecadwallader/codemaid/pull/853) - Visual Studio 2022 Support - thanks [olegtk](https://github.com/olegtk) and many others! - [ ] Fixes - [x] [#800](https://github.com/codecadwallader/codemaid/pull/800) - Reorganizing: Fix dialog showing literal newline characters diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/CPlusPlusTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/CPlusPlusTests.cs deleted file mode 100644 index c32ff6085..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/CPlusPlusTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\CPlusPlus.cpp", "Data")] - public class CPlusPlusTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\CPlusPlus.cpp"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCPlusPlus_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeCPlusPlus = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCPlusPlus_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeCPlusPlus = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCPlusPlus_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeCPlusPlus = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCPlusPlus_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeCPlusPlus = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/CSHTMLTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/CSHTMLTests.cs deleted file mode 100644 index 09a7d7d70..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/CSHTMLTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\CSHTML.cshtml", "Data")] - public class CSHTMLTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\CSHTML.cshtml"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCSHTML_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeHTML = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCSHTML_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeHTML = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCSHTML_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeHTML = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCSHTML_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeHTML = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/CSSTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/CSSTests.cs deleted file mode 100644 index 89c649f47..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/CSSTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\CSS.css", "Data")] - public class CSSTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\CSS.css"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCSS_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeCSS = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCSS_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeCSS = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCSS_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeCSS = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCSS_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeCSS = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/CSharpTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/CSharpTests.cs deleted file mode 100644 index e3ce6397b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/CSharpTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\CSharp.cs", "Data")] - public class CSharpTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\CSharp.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCSharp_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeCSharp = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCSharp_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeCSharp = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCSharp_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeCSharp = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesCSharp_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeCSharp = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CPlusPlus.cpp b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CPlusPlus.cpp deleted file mode 100644 index 4c26cc1e1..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CPlusPlus.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// C++Win32Project.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CSHTML.cshtml b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CSHTML.cshtml deleted file mode 100644 index f8a28a0db..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CSHTML.cshtml +++ /dev/null @@ -1,50 +0,0 @@ -@model MvcApplication1.Models.LoginModel - -@{ - ViewBag.Title = "Log in"; -} - -
-

@ViewBag.Title.

-
- -
-

Use a local account to log in.

-@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl })) { - @Html.AntiForgeryToken() - @Html.ValidationSummary(true) - -
- Log in Form -
    -
  1. - @Html.LabelFor(m => m.UserName) - @Html.TextBoxFor(m => m.UserName) - @Html.ValidationMessageFor(m => m.UserName) -
  2. -
  3. - @Html.LabelFor(m => m.Password) - @Html.PasswordFor(m => m.Password) - @Html.ValidationMessageFor(m => m.Password) -
  4. -
  5. - @Html.CheckBoxFor(m => m.RememberMe) - @Html.LabelFor(m => m.RememberMe, new { @class = "checkbox" }) -
  6. -
- -
-

- @Html.ActionLink("Register", "Register") if you don't have an account. -

-} -
- - - -@section Scripts { - @Scripts.Render("~/bundles/jqueryval") -} diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CSS.css b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CSS.css deleted file mode 100644 index 0e36810ad..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CSS.css +++ /dev/null @@ -1,3 +0,0 @@ -body -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CSharp.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CSharp.cs deleted file mode 100644 index a8b821b02..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/CSharp.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes.Data -{ - public class CSharp - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/EverythingElse.txt b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/EverythingElse.txt deleted file mode 100644 index 66401950e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/EverythingElse.txt +++ /dev/null @@ -1 +0,0 @@ -This is a generic text file. \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/FSharp.fs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/FSharp.fs deleted file mode 100644 index 6cd3571a0..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/FSharp.fs +++ /dev/null @@ -1,35 +0,0 @@ -module File1 - -#r "System.Transactions.dll" -open System -open System.Data -open System.Data.SqlClient - -// [snippet:Dynamic operator] -let (?) (reader:SqlDataReader) (name:string) : 'R = - let typ = typeof<'R> - if typ.IsGenericType && typ.GetGenericTypeDefinition() = typedefof> then - if reader.[name] = box DBNull.Value then - (box null) :?> 'R - else typ.GetMethod("Some").Invoke(null, [| reader.[name] |]) :?> 'R - else - reader.[name] :?> 'R -// [/snippet] - -// [snippet:Example] -let cstr = "Data Source=.\\SQLExpress;Initial Catalog=Northwind;Integrated Security=True" - -let printData() = - use conn = new SqlConnection(cstr) - conn.Open() - use cmd = new SqlCommand("SELECT * FROM [Products]", conn) - - printfn "10 Most Expensive Products\n==========================" - use reader = cmd.ExecuteReader() - while reader.Read() do - let name = reader?ProductName - let price = defaultArg reader?UnitPrice 0.0M - printfn "%s (%A)" name price - -printData() -// [/snippet] \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/HTML.html b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/HTML.html deleted file mode 100644 index 755f822ea..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/HTML.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/JSON.json b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/JSON.json deleted file mode 100644 index 470e6bc8a..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/JSON.json +++ /dev/null @@ -1,11 +0,0 @@ -{"menu": { - "id": "file", - "value": "File", - "popup": { - "menuitem": [ - {"value": "New", "onclick": "CreateNewDoc()"}, - {"value": "Open", "onclick": "OpenDoc()"}, - {"value": "Close", "onclick": "CloseDoc()"} - ] - } -}} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/JavaScript.js b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/JavaScript.js deleted file mode 100644 index 4fcb3ea15..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/JavaScript.js +++ /dev/null @@ -1,19 +0,0 @@ -var Shapes; -(function (Shapes) { - - var Point = Shapes.Point = (function () { - function Point(x, y) { - this.x = x; - this.y = y; - } - Point.prototype.getDist = function () { - return Math.sqrt((this.x * this.x) + (this.y * this.y)); - }; - Point.origin = new Point(0, 0); - return Point; - })(); - -})(Shapes || (Shapes = {})); - -var p = new Shapes.Point(3, 4); -var dist = p.getDist(); diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/LESS.less b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/LESS.less deleted file mode 100644 index 0e36810ad..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/LESS.less +++ /dev/null @@ -1,3 +0,0 @@ -body -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/PHP.php b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/PHP.php deleted file mode 100644 index 0d946951e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/PHP.php +++ /dev/null @@ -1,40 +0,0 @@ -text = "sample"; - } - - /** - * Get the text field. - * @return string The text field. - */ - public function getText() - { - return $this->text; - } - - - - /** - * Set the text field. - * @param string $text - */ - public function setText($text) - { - $this->text = $text; - - } - -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/PowerShell.ps1 b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/PowerShell.ps1 deleted file mode 100644 index 4935ad7c5..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/PowerShell.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -# -# PowerShell.ps1 -# diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/R.R b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/R.R deleted file mode 100644 index cbb1f253f..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/R.R +++ /dev/null @@ -1,13 +0,0 @@ -"This function takes a value x, and does things and returns things that - take several lines to explain" -doEverythingOften <- function(x) { - # Non! Comment it out! We'll just do it once for now. - "if (x %in% 1:9) { - doTenEverythings() - }" - doEverythingOnce() - - return(list( - everythingDone = TRUE, - howOftenDone = 1)) -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/SCSS.scss b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/SCSS.scss deleted file mode 100644 index 46800d16a..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/SCSS.scss +++ /dev/null @@ -1,2 +0,0 @@ -body { -} diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/TypeScript.js b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/TypeScript.js deleted file mode 100644 index 2f9b56882..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/TypeScript.js +++ /dev/null @@ -1,19 +0,0 @@ -var Shapes; -(function (Shapes) { - - var Point = Shapes.Point = (function () { - function Point(x, y) { - this.x = x; - this.y = y; - } - Point.prototype.getDist = function () { - return Math.sqrt((this.x * this.x) + (this.y * this.y)); - }; - Point.origin = new Point(0, 0); - return Point; - })(); - -})(Shapes || (Shapes = {})); - -var p = new Shapes.Point(3, 4); -var dist = p.getDist(); diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/TypeScript.ts b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/TypeScript.ts deleted file mode 100644 index 319ec95a2..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/TypeScript.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Interface -interface IPoint { - getDist(): number; -} - -// Module -module Shapes { - - // Class - export class Point implements IPoint { - // Constructor - constructor (public x: number, public y: number) { } - - // Instance member - getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } - - // Static member - static origin = new Point(0, 0); - } - -} - -// Local variables -var p: IPoint = new Shapes.Point(3, 4); -var dist = p.getDist(); \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/VisualBasic.vb b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/VisualBasic.vb deleted file mode 100644 index b7981052b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/VisualBasic.vb +++ /dev/null @@ -1,30 +0,0 @@ -Module Module1 - Public Sub RoundNumber(ByRef RoundN, _ - Optional Decimals As Integer) - On Error Resume Next - Dim RoundAmount As Single, Result - 'Creates powers to the decimal places - RoundAmount = 10 ^ Decimals - 'Creates a whole number, rounds, applies decimal places - Result = (CLng((RoundN) * RoundAmount) / RoundAmount) - RoundN = Result - End Sub - - ' - ' Calculates age in years from a given date to today's date. - ' - ' - - Function Age(varBirthDate As Object) As Integer - - Dim varAge As Object - If Not IsDate(varBirthDate) Then Exit Function - varAge = DateDiff("yyyy", varBirthDate, Now) - If Date < DateSerial(Year(Now), Month(varBirthDate), _ - Day(varBirthDate)) Then - varAge = varAge - 1 - End If - Age = CInt(varAge) - - End Function -End Module \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/XAML.xaml b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/XAML.xaml deleted file mode 100644 index 42f1cd18c..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/XAML.xaml +++ /dev/null @@ -1,3 +0,0 @@ - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/XML.xml b/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/XML.xml deleted file mode 100644 index 6db91e31b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/Data/XML.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/EverythingElseTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/EverythingElseTests.cs deleted file mode 100644 index 9633ae614..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/EverythingElseTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\EverythingElse.txt", "Data")] - public class EverythingElseTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\EverythingElse.txt"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesEverythingElse_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeEverythingElse = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesEverythingElse_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeEverythingElse = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesEverythingElse_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeEverythingElse = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesEverythingElse_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeEverythingElse = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/FSharpTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/FSharpTests.cs deleted file mode 100644 index 5f7ddabac..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/FSharpTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\FSharp.fs", "Data")] - public class FSharpTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\FSharp.fs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesFSharp_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeFSharp = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesFSharp_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeFSharp = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesFSharp_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeFSharp = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesFSharp_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeFSharp = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/HTMLTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/HTMLTests.cs deleted file mode 100644 index b4c174537..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/HTMLTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\HTML.html", "Data")] - public class HTMLTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\HTML.html"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesHTML_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeHTML = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesHTML_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeHTML = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesHTML_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeHTML = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesHTML_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeHTML = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/JSONTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/JSONTests.cs deleted file mode 100644 index b91b053f8..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/JSONTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\JSON.json", "Data")] - public class JSONTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\JSON.json"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesJSON_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeJSON = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesJSON_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeJSON = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesJSON_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeJSON = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesJSON_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeJSON = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/JavaScriptTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/JavaScriptTests.cs deleted file mode 100644 index c14a30bc0..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/JavaScriptTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\JavaScript.js", "Data")] - public class JavaScriptTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\JavaScript.js"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesJavaScript_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeJavaScript = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesJavaScript_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeJavaScript = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesJavaScript_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeJavaScript = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesJavaScript_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeJavaScript = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/LESSTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/LESSTests.cs deleted file mode 100644 index 126585ade..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/LESSTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\LESS.less", "Data")] - public class LESSTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\LESS.less"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesLESS_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeLESS = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesLESS_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeLESS = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesLESS_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeLESS = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesLESS_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeLESS = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/PHPTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/PHPTests.cs deleted file mode 100644 index 40dfe890d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/PHPTests.cs +++ /dev/null @@ -1,107 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [Ignore] - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\PHP.php", "Data")] - public class PHPTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\PHP.php"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesPHP_EnablesForDocument() - { - Settings.Default.Cleaning_IncludePHP = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesPHP_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludePHP = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesPHP_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludePHP = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesPHP_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludePHP = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/PowerShellTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/PowerShellTests.cs deleted file mode 100644 index 7c9ba1c47..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/PowerShellTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\PowerShell.ps1", "Data")] - public class PowerShellTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\PowerShell.ps1"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesPowerShell_EnablesForDocument() - { - Settings.Default.Cleaning_IncludePowerShell = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesPowerShell_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludePowerShell = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesPowerShell_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludePowerShell = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesPowerShell_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludePowerShell = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/RTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/RTests.cs deleted file mode 100644 index 6080d8d29..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/RTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\R.r", "Data")] - public class RTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\R.r"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesR_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeR = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesR_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeR = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesR_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeR = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesR_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeR = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/SCSSTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/SCSSTests.cs deleted file mode 100644 index 0ea916e52..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/SCSSTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\SCSS.scss", "Data")] - public class SCSSTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\SCSS.scss"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesSCSS_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeSCSS = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesSCSS_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeSCSS = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesSCSS_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeSCSS = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesSCSS_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeSCSS = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/TypeScriptTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/TypeScriptTests.cs deleted file mode 100644 index 9920bc80f..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/TypeScriptTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\TypeScript.ts", "Data")] - public class TypeScriptTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\TypeScript.ts"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesTypeScript_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeTypeScript = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesTypeScript_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeTypeScript = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesTypeScript_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeTypeScript = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesTypeScript_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeTypeScript = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/VisualBasicTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/VisualBasicTests.cs deleted file mode 100644 index b2dcc9000..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/VisualBasicTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\VisualBasic.vb", "Data")] - public class VisualBasicTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\VisualBasic.vb"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesVisualBasic_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeVB = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesVisualBasic_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeVB = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesVisualBasic_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeVB = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesVisualBasic_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeVB = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/XAMLTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/XAMLTests.cs deleted file mode 100644 index 397cc5ecb..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/XAMLTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\XAML.xaml", "Data")] - public class XAMLTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\XAML.xaml"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesXAML_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeXAML = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesXAML_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeXAML = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesXAML_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeXAML = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesXAML_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeXAML = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/FileTypes/XMLTests.cs b/CodeMaid.IntegrationTests/Cleaning/FileTypes/XMLTests.cs deleted file mode 100644 index 372408037..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/FileTypes/XMLTests.cs +++ /dev/null @@ -1,106 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.FileTypes -{ - [TestClass] - [DeploymentItem(@"Cleaning\FileTypes\Data\XML.xml", "Data")] - public class XMLTests - { - #region Setup - - private static CodeCleanupAvailabilityLogic _codeCleanupAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeCleanupAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\XML.xml"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesXML_EnablesForDocument() - { - Settings.Default.Cleaning_IncludeXML = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesXML_EnablesForProjectItem() - { - Settings.Default.Cleaning_IncludeXML = true; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsTrue(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesXML_DisablesForDocumentWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeXML = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningFileTypesXML_DisablesForProjectItemWhenSettingIsDisabled() - { - Settings.Default.Cleaning_IncludeXML = false; - - UIThreadInvoker.Invoke(new Action(() => - { - // Confirm the code cleanup availability logic is in the expected state. - Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupProjectItem(_projectItem)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterClassesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterClassesTests.cs deleted file mode 100644 index e2132ddd5..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterClassesTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterClasses.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterClasses_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterClassesTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterClasses.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterClasses_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterClasses = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterClasses, _projectItem, @"Data\BlankLinePaddingAfterClasses_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterClasses_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterClasses = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterClasses, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterClasses_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterClasses = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterClasses, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterClasses(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var classes = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterCodeElements(classes); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterDelegatesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterDelegatesTests.cs deleted file mode 100644 index 865b03a9b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterDelegatesTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterDelegates.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterDelegates_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterDelegatesTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterDelegates.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterDelegates_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterDelegates = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterDelegates, _projectItem, @"Data\BlankLinePaddingAfterDelegates_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterDelegates_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterDelegates = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterDelegates, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterDelegates_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterDelegates = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterDelegates, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterDelegates(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var delegates = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterCodeElements(delegates); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterEndRegionTagsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterEndRegionTagsTests.cs deleted file mode 100644 index 9d233efcb..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterEndRegionTagsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterEndRegionTags.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterEndRegionTags_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterEndRegionTagsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterEndRegionTags.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterEndRegionTags_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterEndRegionTags = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterEndRegionTags, _projectItem, @"Data\BlankLinePaddingAfterEndRegionTags_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterEndRegionTags_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterEndRegionTags = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterEndRegionTags, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterEndRegionTags_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterEndRegionTags = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterEndRegionTags, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterEndRegionTags(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var regions = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterEndRegionTags(regions); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterEnumerationsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterEnumerationsTests.cs deleted file mode 100644 index 8ba2c6569..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterEnumerationsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterEnumerations.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterEnumerations_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterEnumerationsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterEnumerations.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterEnumerations_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterEnumerations = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterEnumerations, _projectItem, @"Data\BlankLinePaddingAfterEnumerations_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterEnumerations_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterEnumerations = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterEnumerations, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterEnumerations_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterEnumerations = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterEnumerations, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterEnumerations(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var enumerations = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterCodeElements(enumerations); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterEventsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterEventsTests.cs deleted file mode 100644 index 099c24967..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterEventsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterEvents.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterEvents_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterEventsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterEvents.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterEvents_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterEvents = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterEvents, _projectItem, @"Data\BlankLinePaddingAfterEvents_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterEvents_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterEvents = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterEvents, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterEvents_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterEvents = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterEvents, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterEvents(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var events = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterCodeElements(events); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterFieldsMultiLineTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterFieldsMultiLineTests.cs deleted file mode 100644 index 14c869f1b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterFieldsMultiLineTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterFieldsMultiLine.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterFieldsMultiLine_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterFieldsMultiLineTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterFieldsMultiLine.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterFieldsMultiLine_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterFieldsMultiLine = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterFieldsMultiLine, _projectItem, @"Data\BlankLinePaddingAfterFieldsMultiLine_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterFieldsMultiLine_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterFieldsMultiLine = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterFieldsMultiLine, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterFieldsMultiLine_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterFieldsMultiLine = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterFieldsMultiLine, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterFieldsMultiLine(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var fields = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterCodeElements(fields); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterInterfacesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterInterfacesTests.cs deleted file mode 100644 index eac6d4a8b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterInterfacesTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterInterfaces.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterInterfaces_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterInterfacesTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterInterfaces.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterInterfaces_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterInterfaces = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterInterfaces, _projectItem, @"Data\BlankLinePaddingAfterInterfaces_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterInterfaces_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterInterfaces = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterInterfaces, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterInterfaces_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterInterfaces = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterInterfaces, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterInterfaces(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var interfaces = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterCodeElements(interfaces); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterMethodsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterMethodsTests.cs deleted file mode 100644 index 91490397d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterMethodsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterMethods.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterMethods_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterMethodsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterMethods.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterMethods_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterMethods = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterMethods, _projectItem, @"Data\BlankLinePaddingAfterMethods_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterMethods_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterMethods = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterMethods, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterMethods_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterMethods = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterMethods, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterMethods(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var methods = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterCodeElements(methods); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterNamespacesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterNamespacesTests.cs deleted file mode 100644 index d23758ffe..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterNamespacesTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterNamespaces.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterNamespaces_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterNamespacesTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterNamespaces.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterNamespaces_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterNamespaces = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterNamespaces, _projectItem, @"Data\BlankLinePaddingAfterNamespaces_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterNamespaces_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterNamespaces = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterNamespaces, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterNamespaces_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterNamespaces = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterNamespaces, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterNamespaces(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var namespaces = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterCodeElements(namespaces); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterPropertiesMultiLineTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterPropertiesMultiLineTests.cs deleted file mode 100644 index 0c575e598..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterPropertiesMultiLineTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterPropertiesMultiLine.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterPropertiesMultiLine_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterPropertiesMultiLineTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterPropertiesMultiLine.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterPropertiesMultiLine_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterPropertiesMultiLine = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterPropertiesMultiLine, _projectItem, @"Data\BlankLinePaddingAfterPropertiesMultiLine_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterPropertiesMultiLine_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterPropertiesMultiLine = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterPropertiesMultiLine, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterPropertiesMultiLine_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterPropertiesMultiLine = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterPropertiesMultiLine, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterPropertiesMultiLine(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var properties = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterCodeElements(properties); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterPropertiesSingleLineTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterPropertiesSingleLineTests.cs deleted file mode 100644 index 137f7a3bd..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterPropertiesSingleLineTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterPropertiesSingleLine.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterPropertiesSingleLine_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterPropertiesSingleLineTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterPropertiesSingleLine.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterPropertiesSingleLine_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterPropertiesSingleLine = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterPropertiesSingleLine, _projectItem, @"Data\BlankLinePaddingAfterPropertiesSingleLine_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterPropertiesSingleLine_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterPropertiesSingleLine = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterPropertiesSingleLine, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterPropertiesSingleLine_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterPropertiesSingleLine = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterPropertiesSingleLine, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterPropertiesSingleLine(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var properties = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterCodeElements(properties); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterRegionTagsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterRegionTagsTests.cs deleted file mode 100644 index a03e5ce12..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterRegionTagsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterRegionTags.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterRegionTags_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterRegionTagsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterRegionTags.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterRegionTags_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterRegionTags = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterRegionTags, _projectItem, @"Data\BlankLinePaddingAfterRegionTags_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterRegionTags_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterRegionTags = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterRegionTags, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterRegionTags_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterRegionTags = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterRegionTags, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterRegionTags(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var regions = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterRegionTags(regions); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterStructsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterStructsTests.cs deleted file mode 100644 index 602e73948..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterStructsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterStructs.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterStructs_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterStructsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterStructs.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterStructs_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterStructs = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterStructs, _projectItem, @"Data\BlankLinePaddingAfterStructs_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterStructs_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterStructs = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterStructs, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterStructs_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterStructs = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterStructs, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterStructs(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var structs = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterCodeElements(structs); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterUsingStatementBlocksTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterUsingStatementBlocksTests.cs deleted file mode 100644 index be73761b0..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingAfterUsingStatementBlocksTests.cs +++ /dev/null @@ -1,90 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Collections.Generic; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterUsingStatementBlocks.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingAfterUsingStatementBlocks_Cleaned.cs", "Data")] - public class BlankLinePaddingAfterUsingStatementBlocksTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingAfterUsingStatementBlocks.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterUsingStatementBlocks_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterUsingStatementBlocks = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingAfterUsingStatementBlocks, _projectItem, @"Data\BlankLinePaddingAfterUsingStatementBlocks_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterUsingStatementBlocks_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterUsingStatementBlocks = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingAfterUsingStatementBlocks, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingAfterUsingStatementBlocks_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingAfterUsingStatementBlocks = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingAfterUsingStatementBlocks, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingAfterUsingStatementBlocks(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var usingStatements = codeItems.OfType().ToList(); - var usingStatementBlocks = CodeModelHelper.GetCodeItemBlocks(usingStatements).ToList(); - var usingStatementsThatEndBlocks = (from IEnumerable block in usingStatementBlocks select block.Last()).ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingAfterCodeElements(usingStatementsThatEndBlocks); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeCaseStatementsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeCaseStatementsTests.cs deleted file mode 100644 index 5d9b9480e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeCaseStatementsTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeCaseStatements.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeCaseStatements_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeCaseStatementsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeCaseStatements.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeCaseStatements_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeCaseStatements = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeCaseStatements, _projectItem, @"Data\BlankLinePaddingBeforeCaseStatements_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeCaseStatements_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeCaseStatements = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeCaseStatements, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeCaseStatements_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeCaseStatements = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeCaseStatements, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeCaseStatements(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCaseStatements(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeClassesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeClassesTests.cs deleted file mode 100644 index b434169c0..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeClassesTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeClasses.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeClasses_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeClassesTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeClasses.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeClasses_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeClasses = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeClasses, _projectItem, @"Data\BlankLinePaddingBeforeClasses_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeClasses_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeClasses = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeClasses, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeClasses_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeClasses = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeClasses, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeClasses(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var classes = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCodeElements(classes); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeDelegatesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeDelegatesTests.cs deleted file mode 100644 index b6a31e78a..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeDelegatesTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeDelegates.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeDelegates_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeDelegatesTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeDelegates.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeDelegates_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeDelegates = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeDelegates, _projectItem, @"Data\BlankLinePaddingBeforeDelegates_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeDelegates_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeDelegates = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeDelegates, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeDelegates_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeDelegates = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeDelegates, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeDelegates(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var delegates = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCodeElements(delegates); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeEndRegionTagsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeEndRegionTagsTests.cs deleted file mode 100644 index 68d700053..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeEndRegionTagsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeEndRegionTags.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeEndRegionTags_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeEndRegionTagsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeEndRegionTags.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeEndRegionTags_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeEndRegionTags = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeEndRegionTags, _projectItem, @"Data\BlankLinePaddingBeforeEndRegionTags_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeEndRegionTags_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeEndRegionTags = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeEndRegionTags, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeEndRegionTags_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeEndRegionTags = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeEndRegionTags, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeEndRegionTags(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var regions = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeEndRegionTags(regions); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeEnumerationsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeEnumerationsTests.cs deleted file mode 100644 index c47c57082..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeEnumerationsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeEnumerations.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeEnumerations_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeEnumerationsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeEnumerations.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeEnumerations_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeEnumerations = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeEnumerations, _projectItem, @"Data\BlankLinePaddingBeforeEnumerations_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeEnumerations_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeEnumerations = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeEnumerations, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeEnumerations_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeEnumerations = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeEnumerations, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeEnumerations(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var enumerations = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCodeElements(enumerations); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeEventsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeEventsTests.cs deleted file mode 100644 index f83ec6e6b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeEventsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeEvents.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeEvents_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeEventsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeEvents.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeEvents_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeEvents = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeEvents, _projectItem, @"Data\BlankLinePaddingBeforeEvents_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeEvents_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeEvents = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeEvents, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeEvents_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeEvents = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeEvents, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeEvents(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var events = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCodeElements(events); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeFieldsMultiLineTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeFieldsMultiLineTests.cs deleted file mode 100644 index 2dfac2789..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeFieldsMultiLineTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeFieldsMultiLine.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeFieldsMultiLine_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeFieldsMultiLineTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeFieldsMultiLine.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeFieldsMultiLine_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeFieldsMultiLine = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeFieldsMultiLine, _projectItem, @"Data\BlankLinePaddingBeforeFieldsMultiLine_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeFieldsMultiLine_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeFieldsMultiLine = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeFieldsMultiLine, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeFieldsMultiLine_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeFieldsMultiLine = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeFieldsMultiLine, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeFieldsMultiLine(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var fields = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCodeElements(fields); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeInterfacesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeInterfacesTests.cs deleted file mode 100644 index 76d850de7..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeInterfacesTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeInterfaces.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeInterfaces_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeInterfacesTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeInterfaces.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeInterfaces_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeInterfaces = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeInterfaces, _projectItem, @"Data\BlankLinePaddingBeforeInterfaces_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeInterfaces_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeInterfaces = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeInterfaces, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeInterfaces_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeInterfaces = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeInterfaces, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeInterfaces(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var interfaces = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCodeElements(interfaces); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeMethodsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeMethodsTests.cs deleted file mode 100644 index 4a08c7183..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeMethodsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeMethods.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeMethods_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeMethodsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeMethods.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeMethods_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeMethods = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeMethods, _projectItem, @"Data\BlankLinePaddingBeforeMethods_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeMethods_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeMethods = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeMethods, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeMethods_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeMethods = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeMethods, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeMethods(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var methods = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCodeElements(methods); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeNamespacesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeNamespacesTests.cs deleted file mode 100644 index c7623e87c..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeNamespacesTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeNamespaces.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeNamespaces_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeNamespacesTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeNamespaces.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeNamespaces_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeNamespaces = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeNamespaces, _projectItem, @"Data\BlankLinePaddingBeforeNamespaces_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeNamespaces_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeNamespaces = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeNamespaces, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeNamespaces_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeNamespaces = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeNamespaces, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeNamespaces(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var namespaces = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCodeElements(namespaces); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforePropertiesMultiLineTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforePropertiesMultiLineTests.cs deleted file mode 100644 index 915ce506d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforePropertiesMultiLineTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforePropertiesMultiLine.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforePropertiesMultiLine_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforePropertiesMultiLineTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforePropertiesMultiLine.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforePropertiesMultiLine_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforePropertiesMultiLine = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforePropertiesMultiLine, _projectItem, @"Data\BlankLinePaddingBeforePropertiesMultiLine_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforePropertiesMultiLine_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforePropertiesMultiLine = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforePropertiesMultiLine, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforePropertiesMultiLine_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforePropertiesMultiLine = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforePropertiesMultiLine, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforePropertiesMultiLine(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var properties = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCodeElements(properties); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforePropertiesSingleLineTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforePropertiesSingleLineTests.cs deleted file mode 100644 index a12728082..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforePropertiesSingleLineTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforePropertiesSingleLine.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforePropertiesSingleLine_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforePropertiesSingleLineTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforePropertiesSingleLine.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforePropertiesSingleLine_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforePropertiesSingleLine = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforePropertiesSingleLine, _projectItem, @"Data\BlankLinePaddingBeforePropertiesSingleLine_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforePropertiesSingleLine_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforePropertiesSingleLine = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforePropertiesSingleLine, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforePropertiesSingleLine_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforePropertiesSingleLine = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforePropertiesSingleLine, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforePropertiesSingleLine(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var properties = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCodeElements(properties); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeRegionTagsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeRegionTagsTests.cs deleted file mode 100644 index 337726934..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeRegionTagsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeRegionTags.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeRegionTags_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeRegionTagsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeRegionTags.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeRegionTags_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeRegionTags = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeRegionTags, _projectItem, @"Data\BlankLinePaddingBeforeRegionTags_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeRegionTags_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeRegionTags = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeRegionTags, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeRegionTags_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeRegionTags = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeRegionTags, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeRegionTags(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var regions = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeRegionTags(regions); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeSingleLineCommentsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeSingleLineCommentsTests.cs deleted file mode 100644 index e5a4a2379..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeSingleLineCommentsTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeSingleLineComments.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeSingleLineComments_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeSingleLineCommentsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeSingleLineComments.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeSingleLineComments_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeSingleLineComments = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeSingleLineComments, _projectItem, @"Data\BlankLinePaddingBeforeSingleLineComments_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeSingleLineComments_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeSingleLineComments = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeSingleLineComments, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeSingleLineComments_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeSingleLineComments = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeSingleLineComments, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeSingleLineComments(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeSingleLineComments(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeStructsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeStructsTests.cs deleted file mode 100644 index d48b7f676..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeStructsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeStructs.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeStructs_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeStructsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeStructs.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeStructs_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeStructs = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeStructs, _projectItem, @"Data\BlankLinePaddingBeforeStructs_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeStructs_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeStructs = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeStructs, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeStructs_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeStructs = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeStructs, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeStructs(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var structs = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCodeElements(structs); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeUsingStatementBlocksTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeUsingStatementBlocksTests.cs deleted file mode 100644 index d537e23e0..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBeforeUsingStatementBlocksTests.cs +++ /dev/null @@ -1,90 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Collections.Generic; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeUsingStatementBlocks.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBeforeUsingStatementBlocks_Cleaned.cs", "Data")] - public class BlankLinePaddingBeforeUsingStatementBlocksTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBeforeUsingStatementBlocks.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeUsingStatementBlocks_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeUsingStatementBlocks = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBeforeUsingStatementBlocks, _projectItem, @"Data\BlankLinePaddingBeforeUsingStatementBlocks_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeUsingStatementBlocks_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeUsingStatementBlocks = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBeforeUsingStatementBlocks, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBeforeUsingStatementBlocks_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBeforeUsingStatementBlocks = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBeforeUsingStatementBlocks, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBeforeUsingStatementBlocks(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var usingStatements = codeItems.OfType().ToList(); - var usingStatementBlocks = CodeModelHelper.GetCodeItemBlocks(usingStatements).ToList(); - var usingStatementsThatStartBlocks = (from IEnumerable block in usingStatementBlocks select block.First()).ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBeforeCodeElements(usingStatementsThatStartBlocks); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBetweenMultiLinePropertyAccessorsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBetweenMultiLinePropertyAccessorsTests.cs deleted file mode 100644 index ecbd3c83b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankLinePaddingBetweenMultiLinePropertyAccessorsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBetweenMultiLinePropertyAccessors.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankLinePaddingBetweenMultiLinePropertyAccessors_Cleaned.cs", "Data")] - public class BlankLinePaddingBetweenMultiLinePropertyAccessorsTests - { - #region Setup - - private static InsertBlankLinePaddingLogic _insertBlankLinePaddingLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertBlankLinePaddingLogic = InsertBlankLinePaddingLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertBlankLinePaddingLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinePaddingBetweenMultiLinePropertyAccessors.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBetweenMultiLinePropertyAccessors_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBetweenPropertiesMultiLineAccessors = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankLinePaddingBetweenMultiLinePropertyAccessors, _projectItem, @"Data\BlankLinePaddingBetweenMultiLinePropertyAccessors_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBetweenMultiLinePropertyAccessors_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBetweenPropertiesMultiLineAccessors = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankLinePaddingBetweenMultiLinePropertyAccessors, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankLinePaddingBetweenMultiLinePropertyAccessors_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankLinePaddingBetweenPropertiesMultiLineAccessors = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankLinePaddingBetweenMultiLinePropertyAccessors, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankLinePaddingBetweenMultiLinePropertyAccessors(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var properties = codeItems.OfType().ToList(); - - _insertBlankLinePaddingLogic.InsertPaddingBetweenMultiLinePropertyAccessors(properties); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankSpaceBeforeSelfClosingAngleBracketTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/BlankSpaceBeforeSelfClosingAngleBracketTests.cs deleted file mode 100644 index 20519fd8a..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/BlankSpaceBeforeSelfClosingAngleBracketTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\BlankSpaceBeforeSelfClosingAngleBracket.xml", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\BlankSpaceBeforeSelfClosingAngleBracket_Cleaned.xml", "Data")] - public class BlankSpaceBeforeSelfClosingAngleBracketTests - { - #region Setup - - private static InsertWhitespaceLogic _insertWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertWhitespaceLogic = InsertWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankSpaceBeforeSelfClosingAngleBracket.xml"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankSpaceBeforeSelfClosingAngleBracket_CleansAsExpected() - { - Settings.Default.Cleaning_InsertBlankSpaceBeforeSelfClosingAngleBrackets = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertBlankSpaceBeforeSelfClosingAngleBracket, _projectItem, @"Data\BlankSpaceBeforeSelfClosingAngleBracket_Cleaned.xml"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankSpaceBeforeSelfClosingAngleBracket_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertBlankSpaceBeforeSelfClosingAngleBrackets = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertBlankSpaceBeforeSelfClosingAngleBracket, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertBlankSpaceBeforeSelfClosingAngleBracket_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertBlankSpaceBeforeSelfClosingAngleBrackets = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertBlankSpaceBeforeSelfClosingAngleBracket, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertBlankSpaceBeforeSelfClosingAngleBracket(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _insertWhitespaceLogic.InsertBlankSpaceBeforeSelfClosingAngleBracket(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterClasses.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterClasses.cs deleted file mode 100644 index 7ceff458d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterClasses.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class Class1 - { - public class NestedClass1 - { - } - public class NestedClass2 - { - } - public class NestedClass3 - { - } - } - public class Class2 - { - } - public class Class3 - { - } - public enum Enum - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterClasses_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterClasses_Cleaned.cs deleted file mode 100644 index 8c0c0b7b8..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterClasses_Cleaned.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class Class1 - { - public class NestedClass1 - { - } - - public class NestedClass2 - { - } - - public class NestedClass3 - { - } - } - - public class Class2 - { - } - - public class Class3 - { - } - - public enum Enum - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterDelegates.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterDelegates.cs deleted file mode 100644 index bcebcbab1..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterDelegates.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public void delegate Delegate1(); - public void delegate Delegate2(); - public void delegate Delegate3(); - public class BlankLinePaddingAfterDelegates - { - public void delegate Delegate4(); - public void delegate Delegate5(); - public void delegate Delegate6(); - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterDelegates_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterDelegates_Cleaned.cs deleted file mode 100644 index f41e6e0e9..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterDelegates_Cleaned.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public void delegate Delegate1(); - - public void delegate Delegate2(); - - public void delegate Delegate3(); - - public class BlankLinePaddingAfterDelegates - { - public void delegate Delegate4(); - - public void delegate Delegate5(); - - public void delegate Delegate6(); - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEndRegionTags.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEndRegionTags.cs deleted file mode 100644 index 57128c86e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEndRegionTags.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingAfterEndRegionTags - { - #region Region One - #endregion - #region Region Two - #region Nested Region - #endregion - #endregion - #region Region Three - #endregion - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEndRegionTags_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEndRegionTags_Cleaned.cs deleted file mode 100644 index 4d2743467..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEndRegionTags_Cleaned.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingAfterEndRegionTags - { - #region Region One - #endregion - - #region Region Two - #region Nested Region - #endregion - - #endregion - - #region Region Three - #endregion - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEnumerations.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEnumerations.cs deleted file mode 100644 index 56d9a8fe3..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEnumerations.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public enum Enum1 - { - } - public enum Enum2 - { - } - public enum Enum3 - { - } - public class PublicClass - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEnumerations_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEnumerations_Cleaned.cs deleted file mode 100644 index 285e06fa1..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEnumerations_Cleaned.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public enum Enum1 - { - } - - public enum Enum2 - { - } - - public enum Enum3 - { - } - - public class PublicClass - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEvents.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEvents.cs deleted file mode 100644 index 8bebf27af..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEvents.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingAfterEvents - { - public event EventHandler Event1(); - public event EventHandler Event2(); - public event EventHandler Event3(); - public delegate void Delegate1(); - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEvents_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEvents_Cleaned.cs deleted file mode 100644 index 8755860b4..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterEvents_Cleaned.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingAfterEvents - { - public event EventHandler Event1(); - - public event EventHandler Event2(); - - public event EventHandler Event3(); - - public delegate void Delegate1(); - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterFieldsMultiLine.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterFieldsMultiLine.cs deleted file mode 100644 index e9f239e19..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterFieldsMultiLine.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingAfterFieldsMultiLine - { - // Field with a leading comment. - public bool field1; - // Field with a leading comment. - public bool field2; - public bool field3; - // Field with a leading comment. - public bool field4; - /// - /// An XML leading comment field. - /// - public bool field5; - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterFieldsMultiLine_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterFieldsMultiLine_Cleaned.cs deleted file mode 100644 index b1d8b06e3..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterFieldsMultiLine_Cleaned.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingAfterFieldsMultiLine - { - // Field with a leading comment. - public bool field1; - - // Field with a leading comment. - public bool field2; - - public bool field3; - // Field with a leading comment. - public bool field4; - - /// - /// An XML leading comment field. - /// - public bool field5; - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterInterfaces.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterInterfaces.cs deleted file mode 100644 index be3dcf43b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterInterfaces.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public interface Interface1 - { - public interface NestedInterface1 - { - } - public interface NestedInterface2 - { - } - public interface NestedInterface3 - { - } - } - public interface Interface2 - { - } - public interface Interface3 - { - } - public class PublicClass - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterInterfaces_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterInterfaces_Cleaned.cs deleted file mode 100644 index b05302444..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterInterfaces_Cleaned.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public interface Interface1 - { - public interface NestedInterface1 - { - } - - public interface NestedInterface2 - { - } - - public interface NestedInterface3 - { - } - } - - public interface Interface2 - { - } - - public interface Interface3 - { - } - - public class PublicClass - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterMethods.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterMethods.cs deleted file mode 100644 index c846c22e6..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterMethods.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public abstract class BlankLinePaddingAfterMethods - { - public void Method() - { - } - public void Method2() { } - public static StaticMethod() - { - } - public abstract void Method2(); - } - - public class BlankLinePaddingAfterMethods2 - { - private bool field; - static BlankLinePaddingAfterMethods2() - { - } - public BlankLinePaddingAfterMethods() - { - } - public BlankLinePaddingAfterMethods(bool input) - { - } - ~BlankLinePaddingAfterMethods() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterMethods_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterMethods_Cleaned.cs deleted file mode 100644 index cfa9376e2..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterMethods_Cleaned.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public abstract class BlankLinePaddingAfterMethods - { - public void Method() - { - } - - public void Method2() { } - - public static StaticMethod() - { - } - - public abstract void Method2(); - } - - public class BlankLinePaddingAfterMethods2 - { - private bool field; - static BlankLinePaddingAfterMethods2() - { - } - - public BlankLinePaddingAfterMethods() - { - } - - public BlankLinePaddingAfterMethods(bool input) - { - } - - ~BlankLinePaddingAfterMethods() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterNamespaces.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterNamespaces.cs deleted file mode 100644 index 30a0fa6e5..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterNamespaces.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - namespace NestedNamespace1 - { - } - namespace NestedNamespace2 - { - } - namespace NestedNamespace3 - { - } - public class PublicClass - { - } -} -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data2 -{ -} -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data3 -{ -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterNamespaces_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterNamespaces_Cleaned.cs deleted file mode 100644 index 23f8e2300..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterNamespaces_Cleaned.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - namespace NestedNamespace1 - { - } - - namespace NestedNamespace2 - { - } - - namespace NestedNamespace3 - { - } - - public class PublicClass - { - } -} - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data2 -{ -} - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data3 -{ -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesMultiLine.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesMultiLine.cs deleted file mode 100644 index c25bb5289..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesMultiLine.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingAfterPropertiesMultiLine - { - public bool Property4 - { - get { return false; } - } - public bool Property5 - { - get { return false; } - set { } - } - public void Method() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesMultiLine_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesMultiLine_Cleaned.cs deleted file mode 100644 index 6d5c9cfae..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesMultiLine_Cleaned.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingAfterPropertiesMultiLine - { - public bool Property4 - { - get { return false; } - } - - public bool Property5 - { - get { return false; } - set { } - } - - public void Method() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesSingleLine.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesSingleLine.cs deleted file mode 100644 index 49108d129..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesSingleLine.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingAfterPropertiesSingleLine - { - public bool AutoImplementedProperty1 { get; set; } - public bool AutoImplementedProperty2 { get; set; } - public bool AutoImplementedProperty3 { get; set; } - public void Method() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesSingleLine_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesSingleLine_Cleaned.cs deleted file mode 100644 index 6a00a8da7..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterPropertiesSingleLine_Cleaned.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingAfterPropertiesSingleLine - { - public bool AutoImplementedProperty1 { get; set; } - - public bool AutoImplementedProperty2 { get; set; } - - public bool AutoImplementedProperty3 { get; set; } - - public void Method() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterRegionTags.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterRegionTags.cs deleted file mode 100644 index 53bec5129..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterRegionTags.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingAfterRegionTags - { - #region Region One - #endregion - #region Region Two - #region Nested Region - #endregion - #endregion - #region Region Three - #endregion - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterRegionTags_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterRegionTags_Cleaned.cs deleted file mode 100644 index bdbca95db..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterRegionTags_Cleaned.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingAfterRegionTags - { - #region Region One - - #endregion - #region Region Two - - #region Nested Region - - #endregion - #endregion - #region Region Three - - #endregion - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterStructs.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterStructs.cs deleted file mode 100644 index ab4103699..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterStructs.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public struct Struct1 - { - public struct NestedStruct1 - { - } - public struct NestedStruct2 - { - } - public struct NestedStruct3 - { - } - } - public struct Struct2 - { - } - public struct Struct3 - { - } - public class PublicClass - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterStructs_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterStructs_Cleaned.cs deleted file mode 100644 index 4a323271d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterStructs_Cleaned.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public struct Struct1 - { - public struct NestedStruct1 - { - } - - public struct NestedStruct2 - { - } - - public struct NestedStruct3 - { - } - } - - public struct Struct2 - { - } - - public struct Struct3 - { - } - - public class PublicClass - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterUsingStatementBlocks.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterUsingStatementBlocks.cs deleted file mode 100644 index d49914620..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterUsingStatementBlocks.cs +++ /dev/null @@ -1,12 +0,0 @@ -/* Multi-line copyright statements.. - * Carrying over to multiple lines.. */ -using System; -using System.Linq; -#if DEBUG -using System.Diagnostics; -using System.Text; -using System.Text.RegularExpressions; -#endif -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterUsingStatementBlocks_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterUsingStatementBlocks_Cleaned.cs deleted file mode 100644 index dc894be0b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingAfterUsingStatementBlocks_Cleaned.cs +++ /dev/null @@ -1,14 +0,0 @@ -/* Multi-line copyright statements.. - * Carrying over to multiple lines.. */ -using System; -using System.Linq; - -#if DEBUG -using System.Diagnostics; -using System.Text; -using System.Text.RegularExpressions; - -#endif -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeCaseStatements.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeCaseStatements.cs deleted file mode 100644 index 9ff6ef4bb..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeCaseStatements.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforeCaseStatements - { - public void VoidReturnTest() - { - switch (DateTime.Today.DayOfWeek) - { - case DayOfWeek.Monday: - break; - case DayOfWeek.Tuesday: - case DayOfWeek.Wednesday: - return; - case DayOfWeek.Thursday: break; - case DayOfWeek.Friday: return; - case DayOfWeek.Saturday: - case DayOfWeek.Sunday: - return; - default: - return; - } - } - - public int IntReturnTest() - { - switch (DateTime.Today.DayOfWeek) - { - case DayOfWeek.Monday: - return 0; - case DayOfWeek.Tuesday: - case DayOfWeek.Wednesday: - return - 0 + 1; - case DayOfWeek.Thursday: break; - case DayOfWeek.Friday: return 2; - case DayOfWeek.Saturday: - return 3; - default: - return 4; - } - - return 0; - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeCaseStatements_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeCaseStatements_Cleaned.cs deleted file mode 100644 index 598edbb91..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeCaseStatements_Cleaned.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforeCaseStatements - { - public void VoidReturnTest() - { - switch (DateTime.Today.DayOfWeek) - { - case DayOfWeek.Monday: - break; - - case DayOfWeek.Tuesday: - case DayOfWeek.Wednesday: - return; - - case DayOfWeek.Thursday: break; - case DayOfWeek.Friday: return; - case DayOfWeek.Saturday: - case DayOfWeek.Sunday: - return; - - default: - return; - } - } - - public int IntReturnTest() - { - switch (DateTime.Today.DayOfWeek) - { - case DayOfWeek.Monday: - return 0; - - case DayOfWeek.Tuesday: - case DayOfWeek.Wednesday: - return - 0 + 1; - case DayOfWeek.Thursday: break; - case DayOfWeek.Friday: return 2; - case DayOfWeek.Saturday: - return 3; - - default: - return 4; - } - - return 0; - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeClasses.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeClasses.cs deleted file mode 100644 index 7ceff458d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeClasses.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class Class1 - { - public class NestedClass1 - { - } - public class NestedClass2 - { - } - public class NestedClass3 - { - } - } - public class Class2 - { - } - public class Class3 - { - } - public enum Enum - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeClasses_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeClasses_Cleaned.cs deleted file mode 100644 index ef4228afc..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeClasses_Cleaned.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class Class1 - { - public class NestedClass1 - { - } - - public class NestedClass2 - { - } - - public class NestedClass3 - { - } - } - - public class Class2 - { - } - - public class Class3 - { - } - public enum Enum - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeDelegates.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeDelegates.cs deleted file mode 100644 index e66689016..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeDelegates.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public void delegate Delegate1(); - public void delegate Delegate2(); - public void delegate Delegate3(); - public class BlankLinePaddingBeforeDelegates - { - public void delegate Delegate4(); - public void delegate Delegate5(); - public void delegate Delegate6(); - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeDelegates_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeDelegates_Cleaned.cs deleted file mode 100644 index acbfbe2d3..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeDelegates_Cleaned.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public void delegate Delegate1(); - - public void delegate Delegate2(); - - public void delegate Delegate3(); - public class BlankLinePaddingBeforeDelegates - { - public void delegate Delegate4(); - - public void delegate Delegate5(); - - public void delegate Delegate6(); - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEndRegionTags.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEndRegionTags.cs deleted file mode 100644 index 9cf3b8747..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEndRegionTags.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforeEndRegionTags - { - #region Region One - #endregion - #region Region Two - #region Nested Region - #endregion - #endregion - #region Region Three - #endregion - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEndRegionTags_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEndRegionTags_Cleaned.cs deleted file mode 100644 index f34bb4b91..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEndRegionTags_Cleaned.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforeEndRegionTags - { - #region Region One - - #endregion - #region Region Two - #region Nested Region - - #endregion - - #endregion - #region Region Three - - #endregion - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEnumerations.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEnumerations.cs deleted file mode 100644 index 56d9a8fe3..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEnumerations.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public enum Enum1 - { - } - public enum Enum2 - { - } - public enum Enum3 - { - } - public class PublicClass - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEnumerations_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEnumerations_Cleaned.cs deleted file mode 100644 index c69a3cf2f..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEnumerations_Cleaned.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public enum Enum1 - { - } - - public enum Enum2 - { - } - - public enum Enum3 - { - } - public class PublicClass - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEvents.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEvents.cs deleted file mode 100644 index 311f1542b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEvents.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforeEvents - { - public event EventHandler Event1(); - public event EventHandler Event2(); - public event EventHandler Event3(); - public delegate void Delegate1(); - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEvents_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEvents_Cleaned.cs deleted file mode 100644 index 547740f82..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeEvents_Cleaned.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforeEvents - { - public event EventHandler Event1(); - - public event EventHandler Event2(); - - public event EventHandler Event3(); - public delegate void Delegate1(); - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeFieldsMultiLine.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeFieldsMultiLine.cs deleted file mode 100644 index 54a91811c..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeFieldsMultiLine.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforeFieldsMultiLine - { - // Field with a leading comment. - public bool field1; - // Field with a leading comment. - public bool field2; - public bool field3; - // Field with a leading comment. - public bool field4; - /// - /// An XML leading comment field. - /// - public bool field5; - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeFieldsMultiLine_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeFieldsMultiLine_Cleaned.cs deleted file mode 100644 index 7068a6a5e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeFieldsMultiLine_Cleaned.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforeFieldsMultiLine - { - // Field with a leading comment. - public bool field1; - - // Field with a leading comment. - public bool field2; - public bool field3; - - // Field with a leading comment. - public bool field4; - - /// - /// An XML leading comment field. - /// - public bool field5; - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeInterfaces.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeInterfaces.cs deleted file mode 100644 index be3dcf43b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeInterfaces.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public interface Interface1 - { - public interface NestedInterface1 - { - } - public interface NestedInterface2 - { - } - public interface NestedInterface3 - { - } - } - public interface Interface2 - { - } - public interface Interface3 - { - } - public class PublicClass - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeInterfaces_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeInterfaces_Cleaned.cs deleted file mode 100644 index 7ed9a3c78..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeInterfaces_Cleaned.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public interface Interface1 - { - public interface NestedInterface1 - { - } - - public interface NestedInterface2 - { - } - - public interface NestedInterface3 - { - } - } - - public interface Interface2 - { - } - - public interface Interface3 - { - } - public class PublicClass - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeMethods.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeMethods.cs deleted file mode 100644 index 4106cfb32..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeMethods.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public abstract class BlankLinePaddingBeforeMethods - { - public void Method() - { - } - public void Method2() { } - public static StaticMethod() - { - } - public abstract void Method2(); - } - - public class BlankLinePaddingBeforeMethods2 - { - private bool field; - static BlankLinePaddingBeforeMethods2() - { - } - public BlankLinePaddingBeforeMethods() - { - } - public BlankLinePaddingBeforeMethods(bool input) - { - } - ~BlankLinePaddingBeforeMethods() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeMethods_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeMethods_Cleaned.cs deleted file mode 100644 index f03e0dd6d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeMethods_Cleaned.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public abstract class BlankLinePaddingBeforeMethods - { - public void Method() - { - } - - public void Method2() { } - - public static StaticMethod() - { - } - - public abstract void Method2(); - } - - public class BlankLinePaddingBeforeMethods2 - { - private bool field; - - static BlankLinePaddingBeforeMethods2() - { - } - - public BlankLinePaddingBeforeMethods() - { - } - - public BlankLinePaddingBeforeMethods(bool input) - { - } - - ~BlankLinePaddingBeforeMethods() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeNamespaces.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeNamespaces.cs deleted file mode 100644 index 30a0fa6e5..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeNamespaces.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - namespace NestedNamespace1 - { - } - namespace NestedNamespace2 - { - } - namespace NestedNamespace3 - { - } - public class PublicClass - { - } -} -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data2 -{ -} -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data3 -{ -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeNamespaces_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeNamespaces_Cleaned.cs deleted file mode 100644 index 312be1ffc..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeNamespaces_Cleaned.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - namespace NestedNamespace1 - { - } - - namespace NestedNamespace2 - { - } - - namespace NestedNamespace3 - { - } - public class PublicClass - { - } -} - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data2 -{ -} - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data3 -{ -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesMultiLine.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesMultiLine.cs deleted file mode 100644 index ff6a6d87d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesMultiLine.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforePropertiesMultiLine - { - public bool Property4 - { - get { return false; } - } - public bool Property5 - { - get { return false; } - set { } - } - public void Method() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesMultiLine_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesMultiLine_Cleaned.cs deleted file mode 100644 index 3e675082a..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesMultiLine_Cleaned.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforePropertiesMultiLine - { - public bool Property4 - { - get { return false; } - } - - public bool Property5 - { - get { return false; } - set { } - } - public void Method() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesSingleLine.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesSingleLine.cs deleted file mode 100644 index 0c580b26a..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesSingleLine.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforePropertiesSingleLine - { - public bool AutoImplementedProperty1 { get; set; } - public bool AutoImplementedProperty2 { get; set; } - public bool AutoImplementedProperty3 { get; set; } - public void Method() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesSingleLine_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesSingleLine_Cleaned.cs deleted file mode 100644 index 4990cd2bb..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforePropertiesSingleLine_Cleaned.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforePropertiesSingleLine - { - public bool AutoImplementedProperty1 { get; set; } - - public bool AutoImplementedProperty2 { get; set; } - - public bool AutoImplementedProperty3 { get; set; } - public void Method() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeRegionTags.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeRegionTags.cs deleted file mode 100644 index a76fc66c0..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeRegionTags.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforeRegionTags - { - #region Region One - #endregion - #region Region Two - #region Nested Region - #endregion - #endregion - #region Region Three - #endregion - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeRegionTags_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeRegionTags_Cleaned.cs deleted file mode 100644 index 28c51aaa6..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeRegionTags_Cleaned.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforeRegionTags - { - #region Region One - #endregion - - #region Region Two - - #region Nested Region - #endregion - #endregion - - #region Region Three - #endregion - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeSingleLineComments.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeSingleLineComments.cs deleted file mode 100644 index 988a61774..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeSingleLineComments.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforeSingleLineComments - { - // Single line comment after brace does not insert padding. - // Additional comments next to another single line comment does not insert padding. - - private bool _field; - // Floating single line comment inserts padding. - // But not on the following line as well. - - private bool _field2; - //// Quadruple slashed comments are ignored (i.e. commented out comments). - - private void Method() - { - if (true) - { - } - // Comments hanging between sections should be padded. - if (true) - { - } - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeSingleLineComments_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeSingleLineComments_Cleaned.cs deleted file mode 100644 index 5034e7631..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeSingleLineComments_Cleaned.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBeforeSingleLineComments - { - // Single line comment after brace does not insert padding. - // Additional comments next to another single line comment does not insert padding. - - private bool _field; - - // Floating single line comment inserts padding. - // But not on the following line as well. - - private bool _field2; - //// Quadruple slashed comments are ignored (i.e. commented out comments). - - private void Method() - { - if (true) - { - } - - // Comments hanging between sections should be padded. - if (true) - { - } - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeStructs.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeStructs.cs deleted file mode 100644 index ab4103699..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeStructs.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public struct Struct1 - { - public struct NestedStruct1 - { - } - public struct NestedStruct2 - { - } - public struct NestedStruct3 - { - } - } - public struct Struct2 - { - } - public struct Struct3 - { - } - public class PublicClass - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeStructs_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeStructs_Cleaned.cs deleted file mode 100644 index 923df83e8..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeStructs_Cleaned.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public struct Struct1 - { - public struct NestedStruct1 - { - } - - public struct NestedStruct2 - { - } - - public struct NestedStruct3 - { - } - } - - public struct Struct2 - { - } - - public struct Struct3 - { - } - public class PublicClass - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeUsingStatementBlocks.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeUsingStatementBlocks.cs deleted file mode 100644 index d49914620..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeUsingStatementBlocks.cs +++ /dev/null @@ -1,12 +0,0 @@ -/* Multi-line copyright statements.. - * Carrying over to multiple lines.. */ -using System; -using System.Linq; -#if DEBUG -using System.Diagnostics; -using System.Text; -using System.Text.RegularExpressions; -#endif -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeUsingStatementBlocks_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeUsingStatementBlocks_Cleaned.cs deleted file mode 100644 index c0d588403..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBeforeUsingStatementBlocks_Cleaned.cs +++ /dev/null @@ -1,14 +0,0 @@ -/* Multi-line copyright statements.. - * Carrying over to multiple lines.. */ - -using System; -using System.Linq; -#if DEBUG - -using System.Diagnostics; -using System.Text; -using System.Text.RegularExpressions; -#endif -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBetweenMultiLinePropertyAccessors.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBetweenMultiLinePropertyAccessors.cs deleted file mode 100644 index 57b336a38..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBetweenMultiLinePropertyAccessors.cs +++ /dev/null @@ -1,123 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBetweenMultiLinePropertyAccessors - { - private bool _field; - - public bool AutoImplementedProperty { get; set; } - - public bool SingleLineProperty - { - get { return _field; } - set { _field = value; } - } - - public bool SingleLineGetterMultiLineBodySetter - { - get { return _field; } - set - { - if (_field != value) - { - _field = value; - } - } - } - - public bool MultiLineGetterSingleLineSetter - { - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - set { _field = value; } - } - - public bool MultiLineGetterMultiLineSetter - { - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - set - { - if (_field != value) - { - _field = value; - } - } - } - - public bool MultiLineSetterMultiLineGetter - { - set - { - if (_field != value) - { - _field = value; - } - } - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - } - - public bool MultiLineGetterMultiLineSetter2 - { - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - - set - { - if (_field != value) - { - _field = value; - } - } - } - - public bool MultiLineSetterMultiLineGetter2 - { - set - { - if (_field != value) - { - _field = value; - } - } - - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBetweenMultiLinePropertyAccessors_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBetweenMultiLinePropertyAccessors_Cleaned.cs deleted file mode 100644 index e861f2e28..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankLinePaddingBetweenMultiLinePropertyAccessors_Cleaned.cs +++ /dev/null @@ -1,127 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class BlankLinePaddingBetweenMultiLinePropertyAccessors - { - private bool _field; - - public bool AutoImplementedProperty { get; set; } - - public bool SingleLineProperty - { - get { return _field; } - set { _field = value; } - } - - public bool SingleLineGetterMultiLineBodySetter - { - get { return _field; } - - set - { - if (_field != value) - { - _field = value; - } - } - } - - public bool MultiLineGetterSingleLineSetter - { - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - - set { _field = value; } - } - - public bool MultiLineGetterMultiLineSetter - { - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - - set - { - if (_field != value) - { - _field = value; - } - } - } - - public bool MultiLineSetterMultiLineGetter - { - set - { - if (_field != value) - { - _field = value; - } - } - - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - } - - public bool MultiLineGetterMultiLineSetter2 - { - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - - set - { - if (_field != value) - { - _field = value; - } - } - } - - public bool MultiLineSetterMultiLineGetter2 - { - set - { - if (_field != value) - { - _field = value; - } - } - - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - } - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankSpaceBeforeSelfClosingAngleBracket.xml b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankSpaceBeforeSelfClosingAngleBracket.xml deleted file mode 100644 index e5e549262..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankSpaceBeforeSelfClosingAngleBracket.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankSpaceBeforeSelfClosingAngleBracket_Cleaned.xml b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankSpaceBeforeSelfClosingAngleBracket_Cleaned.xml deleted file mode 100644 index 978de42ab..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/BlankSpaceBeforeSelfClosingAngleBracket_Cleaned.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnClasses.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnClasses.cs deleted file mode 100644 index dbb080551..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnClasses.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - class ExplicitAccessModifiersOnClasses - { - } - - public class PublicClass - { - class NestedClass - { - } - - protected class ProtectedClass - { - } - - private class PrivateClass - { - } - } - - internal class InternalClass - { - } - - // Partial classes should be ignored since the access modifier may be specified in another location. - partial class PartialClass - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnClasses_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnClasses_Cleaned.cs deleted file mode 100644 index 1ef0d6595..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnClasses_Cleaned.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - internal class ExplicitAccessModifiersOnClasses - { - } - - public class PublicClass - { - private class NestedClass - { - } - - protected class ProtectedClass - { - } - - private class PrivateClass - { - } - } - - internal class InternalClass - { - } - - // Partial classes should be ignored since the access modifier may be specified in another location. - partial class PartialClass - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnDelegates.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnDelegates.cs deleted file mode 100644 index bac94db16..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnDelegates.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class ExplicitAccessModifiersOnDelegates - { - delegate void UnspecifiedDelegate(); - - public delegate void PublicDelegate(); - - protected delegate void ProtectedDelegate(); - - internal delegate void InternalDelegate(); - - private delegate void PrivateDelegate(); - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnDelegates_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnDelegates_Cleaned.cs deleted file mode 100644 index c9fe3920c..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnDelegates_Cleaned.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class ExplicitAccessModifiersOnDelegates - { - private delegate void UnspecifiedDelegate(); - - public delegate void PublicDelegate(); - - protected delegate void ProtectedDelegate(); - - internal delegate void InternalDelegate(); - - private delegate void PrivateDelegate(); - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEnumerations.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEnumerations.cs deleted file mode 100644 index d27d8917f..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEnumerations.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - enum UnspecifiedEnum - { - } - - public enum PublicEnum - { - } - - internal enum InternalEnum - { - } - - public class ExplicitAccessModifiersOnEnumerations - { - enum UnspecifiedEnum - { - } - - public enum PublicEnum - { - } - - internal enum InternalEnum - { - } - - protected enum ProtectedEnum - { - } - - private enum PrivateEnum - { - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEnumerations_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEnumerations_Cleaned.cs deleted file mode 100644 index a443d4e9f..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEnumerations_Cleaned.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - internal enum UnspecifiedEnum - { - } - - public enum PublicEnum - { - } - - internal enum InternalEnum - { - } - - public class ExplicitAccessModifiersOnEnumerations - { - private enum UnspecifiedEnum - { - } - - public enum PublicEnum - { - } - - internal enum InternalEnum - { - } - - protected enum ProtectedEnum - { - } - - private enum PrivateEnum - { - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEvents.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEvents.cs deleted file mode 100644 index 1163d6778..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEvents.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class ExplicitAccessModifiersOnEvents : IExplicitAccessModifiersOnEvents - { - event EventHandler UnspecifiedEvent; - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - protected event EventHandler ProtectedEvent; - - private event EventHandler PrivateEvent; - - // Explicit interface implementations should not be given an explicit access modifier. - event EventHandler IExplicitAccessModifiersOnEvents.EventInInterface - { - add { } - remove { } - } - } - - public interface IExplicitAccessModifiersOnEvents - { - // Events in an interface should not be given an explicit access modifier. - event EventHandler EventInInterface; - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEvents_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEvents_Cleaned.cs deleted file mode 100644 index 0a196af4b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnEvents_Cleaned.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class ExplicitAccessModifiersOnEvents : IExplicitAccessModifiersOnEvents - { - private event EventHandler UnspecifiedEvent; - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - protected event EventHandler ProtectedEvent; - - private event EventHandler PrivateEvent; - - // Explicit interface implementations should not be given an explicit access modifier. - event EventHandler IExplicitAccessModifiersOnEvents.EventInInterface - { - add { } - remove { } - } - } - - public interface IExplicitAccessModifiersOnEvents - { - // Events in an interface should not be given an explicit access modifier. - event EventHandler EventInInterface; - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnFields.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnFields.cs deleted file mode 100644 index e81233929..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnFields.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class ExplicitAccessModifiersOnFields - { - bool UnspecifiedField; - public bool PublicField; - internal bool InternalField; - protected bool ProtectedField; - private bool PrivateField; - } - - // Enumeration items are registered as fields, but should not be given an explicit access modifier. - public enum ExplicitAccessModifiersOnFieldsEnum - { - EnumItem1, - EnumItem2, - EnumItem3 - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnFields_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnFields_Cleaned.cs deleted file mode 100644 index e7aa1fcb2..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnFields_Cleaned.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class ExplicitAccessModifiersOnFields - { - private bool UnspecifiedField; - public bool PublicField; - internal bool InternalField; - protected bool ProtectedField; - private bool PrivateField; - } - - // Enumeration items are registered as fields, but should not be given an explicit access modifier. - public enum ExplicitAccessModifiersOnFieldsEnum - { - EnumItem1, - EnumItem2, - EnumItem3 - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnInterfaces.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnInterfaces.cs deleted file mode 100644 index 98bf25790..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnInterfaces.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - interface UnknownInterface - { - } - - public interface PublicInterface - { - } - - internal interface InternalInterface - { - } - - public class PublicClass2 - { - interface NestedInterface - { - } - - protected interface ProtectedInterface - { - } - - private interface PrivateInterface - { - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnInterfaces_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnInterfaces_Cleaned.cs deleted file mode 100644 index bc4e142ef..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnInterfaces_Cleaned.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - internal interface UnknownInterface - { - } - - public interface PublicInterface - { - } - - internal interface InternalInterface - { - } - - public class PublicClass2 - { - private interface NestedInterface - { - } - - protected interface ProtectedInterface - { - } - - private interface PrivateInterface - { - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnMethods.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnMethods.cs deleted file mode 100644 index ef938b3a3..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnMethods.cs +++ /dev/null @@ -1,51 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class ExplicitAccessModifiersOnMethods : IExplicitAccessModifiersOnMethods - { - // Skip static constructors - they should not have an access modifier. - static ExplicitAccessModifiersOnMethods() - { - } - - // Skip destructors - they should not have an access modifier. - ~ExplicitAccessModifiersOnMethods() - { - } - - void UnspecifiedMethod() - { - } - - public void PublicMethod() - { - } - - internal void InternalMethod() - { - } - - protected void ProtectedMethod() - { - } - - private void PrivateMethod() - { - } - - // Explicit interface implementations should not be given an explicit access modifier. - void IExplicitAccessModifiersOnMethods.MethodInInterface() - { - } - - // Skip partial methods - access modifier may be specified elsewhere. - partial void PartialMethod() - { - } - } - - public interface IExplicitAccessModifiersOnMethods - { - // Methods in an interface should not be given an explicit access modifier. - void MethodInInterface(); - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnMethods_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnMethods_Cleaned.cs deleted file mode 100644 index 457b7d2f2..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnMethods_Cleaned.cs +++ /dev/null @@ -1,51 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class ExplicitAccessModifiersOnMethods : IExplicitAccessModifiersOnMethods - { - // Skip static constructors - they should not have an access modifier. - static ExplicitAccessModifiersOnMethods() - { - } - - // Skip destructors - they should not have an access modifier. - ~ExplicitAccessModifiersOnMethods() - { - } - - private void UnspecifiedMethod() - { - } - - public void PublicMethod() - { - } - - internal void InternalMethod() - { - } - - protected void ProtectedMethod() - { - } - - private void PrivateMethod() - { - } - - // Explicit interface implementations should not be given an explicit access modifier. - void IExplicitAccessModifiersOnMethods.MethodInInterface() - { - } - - // Skip partial methods - access modifier may be specified elsewhere. - partial void PartialMethod() - { - } - } - - public interface IExplicitAccessModifiersOnMethods - { - // Methods in an interface should not be given an explicit access modifier. - void MethodInInterface(); - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnProperties.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnProperties.cs deleted file mode 100644 index 4e13552ae..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnProperties.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class ExplicitAccessModifiersOnProperties : IExplicitAccessModifiersOnProperties - { - bool UnspecifiedProperty { get; set; } - - public bool PublicProperty { get; set; } - - internal bool InternalProperty { get; set; } - - protected bool ProtectedProperty { get; set; } - - private bool PrivateProperty { get; set; } - - public bool PrivateGetterProperty { private get; set; } - - public bool PrivateSetterProperty { get; private set; } - - // Explicit interface implementations should not be given an explicit access modifier. - bool IExplicitAccessModifiersOnProperties.PropertyInInterface - { - get { return false; } - } - } - - public interface IExplicitAccessModifiersOnProperties - { - // Properties in an interface should not be given an explicit access modifier. - bool PropertyInInterface { get; } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnProperties_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnProperties_Cleaned.cs deleted file mode 100644 index 0dfb6174c..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnProperties_Cleaned.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class ExplicitAccessModifiersOnProperties : IExplicitAccessModifiersOnProperties - { - private bool UnspecifiedProperty { get; set; } - - public bool PublicProperty { get; set; } - - internal bool InternalProperty { get; set; } - - protected bool ProtectedProperty { get; set; } - - private bool PrivateProperty { get; set; } - - public bool PrivateGetterProperty { private get; set; } - - public bool PrivateSetterProperty { get; private set; } - - // Explicit interface implementations should not be given an explicit access modifier. - bool IExplicitAccessModifiersOnProperties.PropertyInInterface - { - get { return false; } - } - } - - public interface IExplicitAccessModifiersOnProperties - { - // Properties in an interface should not be given an explicit access modifier. - bool PropertyInInterface { get; } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnStructs.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnStructs.cs deleted file mode 100644 index e67f0c02d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnStructs.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - struct ExplicitAccessModifiersOnStructs - { - } - - public struct PublicStruct - { - struct NestedStruct - { - } - - private struct PrivateStruct - { - } - } - - internal struct InternalStruct - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnStructs_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnStructs_Cleaned.cs deleted file mode 100644 index 099c57647..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/ExplicitAccessModifiersOnStructs_Cleaned.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - internal struct ExplicitAccessModifiersOnStructs - { - } - - public struct PublicStruct - { - private struct NestedStruct - { - } - - private struct PrivateStruct - { - } - } - - internal struct InternalStruct - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/InsertEndOfFileTrailingNewLine.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/InsertEndOfFileTrailingNewLine.cs deleted file mode 100644 index 2918fcc80..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/InsertEndOfFileTrailingNewLine.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class InsertEndOfFileTrailingNewLine - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/InsertEndOfFileTrailingNewLine_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/Data/InsertEndOfFileTrailingNewLine_Cleaned.cs deleted file mode 100644 index 00294bc3e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/Data/InsertEndOfFileTrailingNewLine_Cleaned.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert.Data -{ - public class InsertEndOfFileTrailingNewLine - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnClassesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnClassesTests.cs deleted file mode 100644 index d5e68e0c6..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnClassesTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnClasses.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnClasses_Cleaned.cs", "Data")] - public class ExplicitAccessModifiersOnClassesTests - { - #region Setup - - private static InsertExplicitAccessModifierLogic _insertExplicitAccessModifierLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertExplicitAccessModifierLogic = InsertExplicitAccessModifierLogic.GetInstance(); - Assert.IsNotNull(_insertExplicitAccessModifierLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\ExplicitAccessModifiersOnClasses.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnClasses_CleansAsExpected() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnClasses = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertExplicitAccessModifiersOnClasses, _projectItem, @"Data\ExplicitAccessModifiersOnClasses_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnClasses_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnClasses = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertExplicitAccessModifiersOnClasses, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnClasses_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnClasses = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertExplicitAccessModifiersOnClasses, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertExplicitAccessModifiersOnClasses(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var classes = codeItems.OfType().ToList(); - - _insertExplicitAccessModifierLogic.InsertExplicitAccessModifiersOnClasses(classes); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnDelegatesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnDelegatesTests.cs deleted file mode 100644 index 9c91bae20..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnDelegatesTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnDelegates.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnDelegates_Cleaned.cs", "Data")] - public class ExplicitAccessModifiersOnDelegatesTests - { - #region Setup - - private static InsertExplicitAccessModifierLogic _insertExplicitAccessModifierLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertExplicitAccessModifierLogic = InsertExplicitAccessModifierLogic.GetInstance(); - Assert.IsNotNull(_insertExplicitAccessModifierLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\ExplicitAccessModifiersOnDelegates.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnDelegates_CleansAsExpected() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnDelegates = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertExplicitAccessModifiersOnDelegates, _projectItem, @"Data\ExplicitAccessModifiersOnDelegates_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnDelegates_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnDelegates = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertExplicitAccessModifiersOnDelegates, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnDelegates_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnDelegates = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertExplicitAccessModifiersOnDelegates, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertExplicitAccessModifiersOnDelegates(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var delegates = codeItems.OfType().ToList(); - - _insertExplicitAccessModifierLogic.InsertExplicitAccessModifiersOnDelegates(delegates); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnEnumerationsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnEnumerationsTests.cs deleted file mode 100644 index 624de3277..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnEnumerationsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnEnumerations.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnEnumerations_Cleaned.cs", "Data")] - public class ExplicitAccessModifiersOnEnumerationsTests - { - #region Setup - - private static InsertExplicitAccessModifierLogic _insertExplicitAccessModifierLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertExplicitAccessModifierLogic = InsertExplicitAccessModifierLogic.GetInstance(); - Assert.IsNotNull(_insertExplicitAccessModifierLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\ExplicitAccessModifiersOnEnumerations.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnEnumerations_CleansAsExpected() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnEnumerations = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertExplicitAccessModifiersOnEnumerations, _projectItem, @"Data\ExplicitAccessModifiersOnEnumerations_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnEnumerations_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnEnumerations = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertExplicitAccessModifiersOnEnumerations, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnEnumerations_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnEnumerations = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertExplicitAccessModifiersOnEnumerations, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertExplicitAccessModifiersOnEnumerations(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var enumerations = codeItems.OfType().ToList(); - - _insertExplicitAccessModifierLogic.InsertExplicitAccessModifiersOnEnumerations(enumerations); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnEventsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnEventsTests.cs deleted file mode 100644 index 877b6dfbf..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnEventsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnEvents.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnEvents_Cleaned.cs", "Data")] - public class ExplicitAccessModifiersOnEventsTests - { - #region Setup - - private static InsertExplicitAccessModifierLogic _insertExplicitAccessModifierLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertExplicitAccessModifierLogic = InsertExplicitAccessModifierLogic.GetInstance(); - Assert.IsNotNull(_insertExplicitAccessModifierLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\ExplicitAccessModifiersOnEvents.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnEvents_CleansAsExpected() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnEvents = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertExplicitAccessModifiersOnEvents, _projectItem, @"Data\ExplicitAccessModifiersOnEvents_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnEvents_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnEvents = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertExplicitAccessModifiersOnEvents, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnEvents_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnEvents = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertExplicitAccessModifiersOnEvents, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertExplicitAccessModifiersOnEvents(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var events = codeItems.OfType().ToList(); - - _insertExplicitAccessModifierLogic.InsertExplicitAccessModifiersOnEvents(events); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnFieldsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnFieldsTests.cs deleted file mode 100644 index 32f4cb826..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnFieldsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnFields.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnFields_Cleaned.cs", "Data")] - public class ExplicitAccessModifiersOnFieldsTests - { - #region Setup - - private static InsertExplicitAccessModifierLogic _insertExplicitAccessModifierLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertExplicitAccessModifierLogic = InsertExplicitAccessModifierLogic.GetInstance(); - Assert.IsNotNull(_insertExplicitAccessModifierLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\ExplicitAccessModifiersOnFields.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnFields_CleansAsExpected() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnFields = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertExplicitAccessModifiersOnFields, _projectItem, @"Data\ExplicitAccessModifiersOnFields_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnFields_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnFields = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertExplicitAccessModifiersOnFields, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnFields_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnFields = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertExplicitAccessModifiersOnFields, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertExplicitAccessModifiersOnFields(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var fields = codeItems.OfType().ToList(); - - _insertExplicitAccessModifierLogic.InsertExplicitAccessModifiersOnFields(fields); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnInterfacesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnInterfacesTests.cs deleted file mode 100644 index 4c9a76505..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnInterfacesTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnInterfaces.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnInterfaces_Cleaned.cs", "Data")] - public class ExplicitAccessModifiersOnInterfacesTests - { - #region Setup - - private static InsertExplicitAccessModifierLogic _insertExplicitAccessModifierLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertExplicitAccessModifierLogic = InsertExplicitAccessModifierLogic.GetInstance(); - Assert.IsNotNull(_insertExplicitAccessModifierLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\ExplicitAccessModifiersOnInterfaces.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnInterfaces_CleansAsExpected() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnInterfaces = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertExplicitAccessModifiersOnInterfaces, _projectItem, @"Data\ExplicitAccessModifiersOnInterfaces_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnInterfaces_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnInterfaces = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertExplicitAccessModifiersOnInterfaces, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnInterfaces_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnInterfaces = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertExplicitAccessModifiersOnInterfaces, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertExplicitAccessModifiersOnInterfaces(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var interfaces = codeItems.OfType().ToList(); - - _insertExplicitAccessModifierLogic.InsertExplicitAccessModifiersOnInterfaces(interfaces); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnMethodsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnMethodsTests.cs deleted file mode 100644 index 0cd5dcd3a..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnMethodsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnMethods.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnMethods_Cleaned.cs", "Data")] - public class ExplicitAccessModifiersOnMethodsTests - { - #region Setup - - private static InsertExplicitAccessModifierLogic _insertExplicitAccessModifierLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertExplicitAccessModifierLogic = InsertExplicitAccessModifierLogic.GetInstance(); - Assert.IsNotNull(_insertExplicitAccessModifierLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\ExplicitAccessModifiersOnMethods.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnMethods_CleansAsExpected() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnMethods = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertExplicitAccessModifiersOnMethods, _projectItem, @"Data\ExplicitAccessModifiersOnMethods_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnMethods_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnMethods = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertExplicitAccessModifiersOnMethods, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnMethods_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnMethods = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertExplicitAccessModifiersOnMethods, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertExplicitAccessModifiersOnMethods(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var methods = codeItems.OfType().ToList(); - - _insertExplicitAccessModifierLogic.InsertExplicitAccessModifiersOnMethods(methods); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnPropertiesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnPropertiesTests.cs deleted file mode 100644 index d8faca615..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnPropertiesTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnProperties.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnProperties_Cleaned.cs", "Data")] - public class ExplicitAccessModifiersOnPropertiesTests - { - #region Setup - - private static InsertExplicitAccessModifierLogic _insertExplicitAccessModifierLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertExplicitAccessModifierLogic = InsertExplicitAccessModifierLogic.GetInstance(); - Assert.IsNotNull(_insertExplicitAccessModifierLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\ExplicitAccessModifiersOnProperties.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnProperties_CleansAsExpected() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnProperties = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertExplicitAccessModifiersOnProperties, _projectItem, @"Data\ExplicitAccessModifiersOnProperties_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnProperties_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnProperties = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertExplicitAccessModifiersOnProperties, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnProperties_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnProperties = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertExplicitAccessModifiersOnProperties, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertExplicitAccessModifiersOnProperties(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var properties = codeItems.OfType().ToList(); - - _insertExplicitAccessModifierLogic.InsertExplicitAccessModifiersOnProperties(properties); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnStructsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnStructsTests.cs deleted file mode 100644 index ee5de66ac..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/ExplicitAccessModifiersOnStructsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnStructs.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\ExplicitAccessModifiersOnStructs_Cleaned.cs", "Data")] - public class ExplicitAccessModifiersOnStructsTests - { - #region Setup - - private static InsertExplicitAccessModifierLogic _insertExplicitAccessModifierLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertExplicitAccessModifierLogic = InsertExplicitAccessModifierLogic.GetInstance(); - Assert.IsNotNull(_insertExplicitAccessModifierLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\ExplicitAccessModifiersOnStructs.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnStructs_CleansAsExpected() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnStructs = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertExplicitAccessModifiersOnStructs, _projectItem, @"Data\ExplicitAccessModifiersOnStructs_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnStructs_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnStructs = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertExplicitAccessModifiersOnStructs, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertExplicitAccessModifiersOnStructs_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertExplicitAccessModifiersOnStructs = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertExplicitAccessModifiersOnStructs, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertExplicitAccessModifiersOnStructs(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var structs = codeItems.OfType().ToList(); - - _insertExplicitAccessModifierLogic.InsertExplicitAccessModifiersOnStructs(structs); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Insert/InsertEndOfFileTrailingNewLineTests.cs b/CodeMaid.IntegrationTests/Cleaning/Insert/InsertEndOfFileTrailingNewLineTests.cs deleted file mode 100644 index 09459128f..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Insert/InsertEndOfFileTrailingNewLineTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Insert -{ - [TestClass] - [DeploymentItem(@"Cleaning\Insert\Data\InsertEndOfFileTrailingNewLine.cs", "Data")] - [DeploymentItem(@"Cleaning\Insert\Data\InsertEndOfFileTrailingNewLine_Cleaned.cs", "Data")] - public class InsertEndOfFileTrailingNewLineTests - { - #region Setup - - private static InsertWhitespaceLogic _insertWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _insertWhitespaceLogic = InsertWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_insertWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\InsertEndOfFileTrailingNewLine.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertEndOfFileTrailingNewLine_CleansAsExpected() - { - Settings.Default.Cleaning_InsertEndOfFileTrailingNewLine = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunInsertEndOfFileTrailingNewLine, _projectItem, @"Data\InsertEndOfFileTrailingNewLine_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertEndOfFileTrailingNewLine_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_InsertEndOfFileTrailingNewLine = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunInsertEndOfFileTrailingNewLine, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningInsertEndOfFileTrailingNewLine_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_InsertEndOfFileTrailingNewLine = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunInsertEndOfFileTrailingNewLine, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunInsertEndOfFileTrailingNewLine(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _insertWhitespaceLogic.InsertEOFTrailingNewLine(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAfterAttributesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAfterAttributesTests.cs deleted file mode 100644 index 166a4257b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAfterAttributesTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesAfterAttributes.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesAfterAttributes_Cleaned.cs", "Data")] - public class BlankLinesAfterAttributesTests - { - #region Setup - - private static RemoveWhitespaceLogic _removeWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinesAfterAttributes.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesAfterAttributes_CleansAsExpected() - { - Settings.Default.Cleaning_RemoveBlankLinesAfterAttributes = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveBlankLinesAfterAttributes, _projectItem, @"Data\BlankLinesAfterAttributes_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesAfterAttributes_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RemoveBlankLinesAfterAttributes = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveBlankLinesAfterAttributes, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesAfterAttributes_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RemoveBlankLinesAfterAttributes = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveBlankLinesAfterAttributes, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveBlankLinesAfterAttributes(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _removeWhitespaceLogic.RemoveBlankLinesAfterAttributes(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAfterOpeningBraceTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAfterOpeningBraceTests.cs deleted file mode 100644 index 3a40233d7..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAfterOpeningBraceTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesAfterOpeningBrace.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesAfterOpeningBrace_Cleaned.cs", "Data")] - public class BlankLinesAfterOpeningBraceTests - { - #region Setup - - private static RemoveWhitespaceLogic _removeWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinesAfterOpeningBrace.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesAfterOpeningBrace_CleansAsExpected() - { - Settings.Default.Cleaning_RemoveBlankLinesAfterOpeningBrace = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveBlankLinesAfterOpeningBrace, _projectItem, @"Data\BlankLinesAfterOpeningBrace_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesAfterOpeningBrace_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RemoveBlankLinesAfterOpeningBrace = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveBlankLinesAfterOpeningBrace, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesAfterOpeningBrace_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RemoveBlankLinesAfterOpeningBrace = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveBlankLinesAfterOpeningBrace, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveBlankLinesAfterOpeningBrace(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _removeWhitespaceLogic.RemoveBlankLinesAfterOpeningBrace(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAtBottomTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAtBottomTests.cs deleted file mode 100644 index 0f00027e1..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAtBottomTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesAtBottom.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesAtBottom_Cleaned.cs", "Data")] - public class BlankLinesAtBottomTests - { - #region Setup - - private static RemoveWhitespaceLogic _removeWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinesAtBottom.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesAtBottom_CleansAsExpected() - { - Settings.Default.Cleaning_RemoveBlankLinesAtBottom = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveBlankLinesAtBottom, _projectItem, @"Data\BlankLinesAtBottom_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesAtBottom_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RemoveBlankLinesAtBottom = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveBlankLinesAtBottom, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesAtBottom_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RemoveBlankLinesAtBottom = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveBlankLinesAtBottom, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveBlankLinesAtBottom(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _removeWhitespaceLogic.RemoveBlankLinesAtBottom(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAtTopTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAtTopTests.cs deleted file mode 100644 index 856f7bff0..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesAtTopTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesAtTop.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesAtTop_Cleaned.cs", "Data")] - public class BlankLinesAtTopTests - { - #region Setup - - private static RemoveWhitespaceLogic _removeWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinesAtTop.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesAtTop_CleansAsExpected() - { - Settings.Default.Cleaning_RemoveBlankLinesAtTop = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveBlankLinesAtTop, _projectItem, @"Data\BlankLinesAtTop_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesAtTop_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RemoveBlankLinesAtTop = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveBlankLinesAtTop, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesAtTop_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RemoveBlankLinesAtTop = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveBlankLinesAtTop, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveBlankLinesAtTop(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _removeWhitespaceLogic.RemoveBlankLinesAtTop(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesBeforeClosingBraceTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesBeforeClosingBraceTests.cs deleted file mode 100644 index 19b750557..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesBeforeClosingBraceTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesBeforeClosingBrace.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesBeforeClosingBrace_Cleaned.cs", "Data")] - public class BlankLinesBeforeClosingBraceTests - { - #region Setup - - private static RemoveWhitespaceLogic _removeWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinesBeforeClosingBrace.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesBeforeClosingBrace_CleansAsExpected() - { - Settings.Default.Cleaning_RemoveBlankLinesBeforeClosingBrace = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveBlankLinesBeforeClosingBrace, _projectItem, @"Data\BlankLinesBeforeClosingBrace_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesBeforeClosingBrace_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RemoveBlankLinesBeforeClosingBrace = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveBlankLinesBeforeClosingBrace, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesBeforeClosingBrace_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RemoveBlankLinesBeforeClosingBrace = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveBlankLinesBeforeClosingBrace, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveBlankLinesBeforeClosingBrace(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _removeWhitespaceLogic.RemoveBlankLinesBeforeClosingBrace(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesBeforeClosingTagTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesBeforeClosingTagTests.cs deleted file mode 100644 index f2aec45ac..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesBeforeClosingTagTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesBeforeClosingTag.xml", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesBeforeClosingTag_Cleaned.xml", "Data")] - public class BlankLinesBeforeClosingTagTests - { - #region Setup - - private static RemoveWhitespaceLogic _removeWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinesBeforeClosingTag.xml"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesBeforeClosingTag_CleansAsExpected() - { - Settings.Default.Cleaning_RemoveBlankLinesBeforeClosingTags = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveBlankLinesBeforeClosingTag, _projectItem, @"Data\BlankLinesBeforeClosingTag_Cleaned.xml"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesBeforeClosingTag_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RemoveBlankLinesBeforeClosingTags = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveBlankLinesBeforeClosingTag, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesBeforeClosingTag_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RemoveBlankLinesBeforeClosingTags = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveBlankLinesBeforeClosingTag, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveBlankLinesBeforeClosingTag(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _removeWhitespaceLogic.RemoveBlankLinesBeforeClosingTag(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesBetweenChainedStatementsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesBetweenChainedStatementsTests.cs deleted file mode 100644 index b18c80c69..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankLinesBetweenChainedStatementsTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesBetweenChainedStatements.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\BlankLinesBetweenChainedStatements_Cleaned.cs", "Data")] - public class BlankLinesBetweenChainedStatementsTests - { - #region Setup - - private static RemoveWhitespaceLogic _removeWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankLinesBetweenChainedStatements.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesBetweenChainedStatements_CleansAsExpected() - { - Settings.Default.Cleaning_RemoveBlankLinesBetweenChainedStatements = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveBlankLinesBetweenChainedStatements, _projectItem, @"Data\BlankLinesBetweenChainedStatements_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesBetweenChainedStatements_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RemoveBlankLinesBetweenChainedStatements = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveBlankLinesBetweenChainedStatements, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankLinesBetweenChainedStatements_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RemoveBlankLinesBetweenChainedStatements = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveBlankLinesBetweenChainedStatements, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveBlankLinesBetweenChainedStatements(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _removeWhitespaceLogic.RemoveBlankLinesBetweenChainedStatements(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankSpacesBeforeClosingAngleBracketTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/BlankSpacesBeforeClosingAngleBracketTests.cs deleted file mode 100644 index d5ce5428e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/BlankSpacesBeforeClosingAngleBracketTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\BlankSpacesBeforeClosingAngleBracket.xml", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\BlankSpacesBeforeClosingAngleBracket_Cleaned.xml", "Data")] - public class BlankSpacesBeforeClosingAngleBracketTests - { - #region Setup - - private static RemoveWhitespaceLogic _removeWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\BlankSpacesBeforeClosingAngleBracket.xml"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankSpacesBeforeClosingAngleBracket_CleansAsExpected() - { - Settings.Default.Cleaning_RemoveBlankSpacesBeforeClosingAngleBrackets = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveBlankSpacesBeforeClosingAngleBracket, _projectItem, @"Data\BlankSpacesBeforeClosingAngleBracket_Cleaned.xml"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankSpacesBeforeClosingAngleBracket_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RemoveBlankSpacesBeforeClosingAngleBrackets = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveBlankSpacesBeforeClosingAngleBracket, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveBlankSpacesBeforeClosingAngleBracket_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RemoveBlankSpacesBeforeClosingAngleBrackets = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveBlankSpacesBeforeClosingAngleBracket, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveBlankSpacesBeforeClosingAngleBracket(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _removeWhitespaceLogic.RemoveBlankSpacesBeforeClosingAngleBracket(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterAttributes.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterAttributes.cs deleted file mode 100644 index 27cebef05..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterAttributes.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.ComponentModel; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - [Description("Some description")] // Trailing comments should be kept in place - - public class BlankLinesAfterAttributes - { - public void NoAttributeMethod() - { - } - - [Description("Some description")] - - - public void SingleAttributeMethod() - { - } - - [Description("Some description")] // Trailing comments should be kept in place - - - [Category("Some category")] - - public void MultipleAttributeMethod() - { - // Oddly formatted, but legal arrays should be left intact. - int[] - - intArray = - new int[5] - - ; - - // Multi-line strings with right brackets should be left intact. - Console.Write(@" -Line 1] - -Line 2] - -"); - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterAttributes_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterAttributes_Cleaned.cs deleted file mode 100644 index d5696196e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterAttributes_Cleaned.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.ComponentModel; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - [Description("Some description")] // Trailing comments should be kept in place - public class BlankLinesAfterAttributes - { - public void NoAttributeMethod() - { - } - - [Description("Some description")] - public void SingleAttributeMethod() - { - } - - [Description("Some description")] // Trailing comments should be kept in place - [Category("Some category")] - public void MultipleAttributeMethod() - { - // Oddly formatted, but legal arrays should be left intact. - int[] - - intArray = - new int[5] - - ; - - // Multi-line strings with right brackets should be left intact. - Console.Write(@" -Line 1] - -Line 2] - -"); - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterOpeningBrace.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterOpeningBrace.cs deleted file mode 100644 index 3c4e3d1aa..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterOpeningBrace.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class BlankLinesAfterOpeningBrace - { - - - public void Method() - { - - if (true) - { // Trailing comments should be kept in place. - - } - else - { - - - - - } - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterOpeningBrace_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterOpeningBrace_Cleaned.cs deleted file mode 100644 index 649582006..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAfterOpeningBrace_Cleaned.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class BlankLinesAfterOpeningBrace - { - public void Method() - { - if (true) - { // Trailing comments should be kept in place. - } - else - { - } - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtBottom.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtBottom.cs deleted file mode 100644 index e51b0e900..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtBottom.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class BlankLinesAtBottom - { - } -} - - diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtBottom_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtBottom_Cleaned.cs deleted file mode 100644 index b10d9526b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtBottom_Cleaned.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class BlankLinesAtBottom - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtTop.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtTop.cs deleted file mode 100644 index c3ef4172d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtTop.cs +++ /dev/null @@ -1,9 +0,0 @@ - - - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class BlankLinesAtTop - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtTop_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtTop_Cleaned.cs deleted file mode 100644 index 1b948df6b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesAtTop_Cleaned.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class BlankLinesAtTop - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingBrace.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingBrace.cs deleted file mode 100644 index 6b0f70a5e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingBrace.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class BlankLinesBeforeClosingBrace - { - public void Method() - { - if (true) - { - - - } - else - { - - } - - - - - } - } - - -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingBrace_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingBrace_Cleaned.cs deleted file mode 100644 index 25979d645..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingBrace_Cleaned.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class BlankLinesBeforeClosingBrace - { - public void Method() - { - if (true) - { - } - else - { - } - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingTag.xml b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingTag.xml deleted file mode 100644 index eceb0773e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingTag.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingTag_Cleaned.xml b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingTag_Cleaned.xml deleted file mode 100644 index 32e57dd7b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBeforeClosingTag_Cleaned.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBetweenChainedStatements.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBetweenChainedStatements.cs deleted file mode 100644 index c73bc607e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBetweenChainedStatements.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class BlankLinesBetweenChainedStatements - { - public void Method() - { - if (true) - { - } - - else - { - } - - if (false) - { - } - - - else if (true) - { - } - - else - { - - } - - try - { - } - - catch (Exception) - { - } - - try - { - - } - - catch (Exception) - { - - } - - finally - { - - } - - if (true) - { - - } - // Separating comment, should be ignored - - - else - { - - } - - try - { - - } - // Comment explaining the catch statement, should be ignored - catch (Exception) - { - - throw; - } - } - } - - -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBetweenChainedStatements_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBetweenChainedStatements_Cleaned.cs deleted file mode 100644 index 863e046fb..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankLinesBetweenChainedStatements_Cleaned.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class BlankLinesBetweenChainedStatements - { - public void Method() - { - if (true) - { - } - else - { - } - - if (false) - { - } - else if (true) - { - } - else - { - - } - - try - { - } - catch (Exception) - { - } - - try - { - - } - catch (Exception) - { - - } - finally - { - - } - - if (true) - { - - } - // Separating comment, should be ignored - else - { - - } - - try - { - - } - // Comment explaining the catch statement, should be ignored - catch (Exception) - { - - throw; - } - } - } - - -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankSpacesBeforeClosingAngleBracket.xml b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankSpacesBeforeClosingAngleBracket.xml deleted file mode 100644 index 97dd660a8..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankSpacesBeforeClosingAngleBracket.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankSpacesBeforeClosingAngleBracket_Cleaned.xml b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankSpacesBeforeClosingAngleBracket_Cleaned.xml deleted file mode 100644 index e0517b1a9..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/BlankSpacesBeforeClosingAngleBracket_Cleaned.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/EndOfLineWhitespace.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/EndOfLineWhitespace.cs deleted file mode 100644 index 105e90926..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/EndOfLineWhitespace.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class CleaningRemoveEndOfLineWhitespace - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/EndOfLineWhitespace_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/EndOfLineWhitespace_Cleaned.cs deleted file mode 100644 index 5f1803687..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/EndOfLineWhitespace_Cleaned.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class CleaningRemoveEndOfLineWhitespace - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/MultipleConsecutiveBlankLines.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/MultipleConsecutiveBlankLines.cs deleted file mode 100644 index f4e95b720..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/MultipleConsecutiveBlankLines.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - - - - public class CleaningRemoveMultipleConsecutiveBlankLines - { - - private void Method() - { - - - } - - - } - - - - - - -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/MultipleConsecutiveBlankLines_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/MultipleConsecutiveBlankLines_Cleaned.cs deleted file mode 100644 index c559790d6..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/MultipleConsecutiveBlankLines_Cleaned.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - - public class CleaningRemoveMultipleConsecutiveBlankLines - { - - private void Method() - { - - } - - } - -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveAllRegions.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveAllRegions.cs deleted file mode 100644 index efa158b7e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveAllRegions.cs +++ /dev/null @@ -1,66 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - internal class Regions - { - #region Fields - - private bool _field; - - #endregion Fields - - /* placeholder */ - /* placeholder */ - - #region Constructors - - public Regions() - { - #region In-Method region - - bool var1; - - #endregion In-Method region - - #region In-Method region - - #region Nested In-Method region - bool var2; - - #endregion - - #endregion In-Method region - } - - #endregion Constructors - - /* placeholder */ - /* placeholder */ - - #region Properties - - public bool Property - { - get { return _field; } - set { _field = value; } - } - - #endregion Properties - - #region Methods - - private void Method() - { - } - - #endregion Methods - - #region Region One - #endregion - #region Region Two - #region Nested Region - #endregion - #endregion - #region Region Three - #endregion - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveAllRegions_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveAllRegions_Cleaned.cs deleted file mode 100644 index ee65a0f5b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveAllRegions_Cleaned.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - internal class Regions - { - - private bool _field; - - /* placeholder */ - /* placeholder */ - - public Regions() - { - - bool var1; - - bool var2; - - } - - /* placeholder */ - /* placeholder */ - - public bool Property - { - get { return _field; } - set { _field = value; } - } - - private void Method() - { - } - - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveCurrentRegion.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveCurrentRegion.cs deleted file mode 100644 index 5cdbe625d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveCurrentRegion.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - internal class Regions - { - #region Fields - - private bool _field; - - #endregion Fields - - /* placeholder */ - /* placeholder */ - - #region Constructors - - public Regions() - { - #region In-Method region - - bool var1; - - #endregion In-Method region - - #region In-Method region - - bool var2; - - #endregion In-Method region - } - - #endregion Constructors - - /* placeholder */ - /* placeholder */ - - #region Properties - - public bool Property - { - get { return _field; } - set { _field = value; } - } - - #endregion Properties - - #region Methods - - private void Method() - { - } - - #endregion Methods - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveCurrentRegion_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveCurrentRegion_Cleaned.cs deleted file mode 100644 index 7a4c46233..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveCurrentRegion_Cleaned.cs +++ /dev/null @@ -1,51 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - internal class Regions - { - #region Fields - - private bool _field; - - #endregion Fields - - /* placeholder */ - /* placeholder */ - - #region Constructors - - public Regions() - { - - bool var1; - - #region In-Method region - - bool var2; - - #endregion In-Method region - } - - #endregion Constructors - - /* placeholder */ - /* placeholder */ - - #region Properties - - public bool Property - { - get { return _field; } - set { _field = value; } - } - - #endregion Properties - - #region Methods - - private void Method() - { - } - - #endregion Methods - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEmptyRegions.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEmptyRegions.cs deleted file mode 100644 index dcdb5f91c..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEmptyRegions.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - internal class Regions - { - #region Region One - #endregion - #region Region Two - #region Nested Region - #endregion - #endregion - #region Region Three - #endregion - #region Region Four - #region Region Four.One - #region Region Four.One.One - #region Region Four.One.One.One - #endregion - #region Region Four.One.One.Two - #endregion - #endregion - #region Region Four.One.Two - #endregion - #region Region Four.One.Three - - - #endregion - #endregion - #region Region Four.Two - - - #endregion - #endregion - #region Region with a comment - // Region should remain - #endregion - #region Region with a nested region with a comment - #region Nested region with a comment - // Region and parent region should remain - #endregion - #region Other nested regions should still be removed - #region Including nested nested - #endregion - #endregion - #endregion - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEmptyRegions_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEmptyRegions_Cleaned.cs deleted file mode 100644 index 1098f4855..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEmptyRegions_Cleaned.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - internal class Regions - { - - #region Region with a comment - // Region should remain - #endregion - #region Region with a nested region with a comment - #region Nested region with a comment - // Region and parent region should remain - #endregion - - #endregion - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEndOfFileTrailingNewLine.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEndOfFileTrailingNewLine.cs deleted file mode 100644 index f0152a2b2..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEndOfFileTrailingNewLine.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class RemoveEndOfFileTrailingNewLine - { - } -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEndOfFileTrailingNewLine_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEndOfFileTrailingNewLine_Cleaned.cs deleted file mode 100644 index 8169e7a69..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveEndOfFileTrailingNewLine_Cleaned.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - public class RemoveEndOfFileTrailingNewLine - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSelectedRegions.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSelectedRegions.cs deleted file mode 100644 index 5cdbe625d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSelectedRegions.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - internal class Regions - { - #region Fields - - private bool _field; - - #endregion Fields - - /* placeholder */ - /* placeholder */ - - #region Constructors - - public Regions() - { - #region In-Method region - - bool var1; - - #endregion In-Method region - - #region In-Method region - - bool var2; - - #endregion In-Method region - } - - #endregion Constructors - - /* placeholder */ - /* placeholder */ - - #region Properties - - public bool Property - { - get { return _field; } - set { _field = value; } - } - - #endregion Properties - - #region Methods - - private void Method() - { - } - - #endregion Methods - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSelectedRegions_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSelectedRegions_Cleaned.cs deleted file mode 100644 index 38864c54e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSelectedRegions_Cleaned.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - internal class Regions - { - #region Fields - - private bool _field; - - #endregion Fields - - /* placeholder */ - /* placeholder */ - - public Regions() - { - - bool var1; - - bool var2; - - } - - /* placeholder */ - /* placeholder */ - - public bool Property - { - get { return _field; } - set { _field = value; } - } - - #region Methods - - private void Method() - { - } - - #endregion Methods - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSetOfRegions.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSetOfRegions.cs deleted file mode 100644 index 5cdbe625d..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSetOfRegions.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - internal class Regions - { - #region Fields - - private bool _field; - - #endregion Fields - - /* placeholder */ - /* placeholder */ - - #region Constructors - - public Regions() - { - #region In-Method region - - bool var1; - - #endregion In-Method region - - #region In-Method region - - bool var2; - - #endregion In-Method region - } - - #endregion Constructors - - /* placeholder */ - /* placeholder */ - - #region Properties - - public bool Property - { - get { return _field; } - set { _field = value; } - } - - #endregion Properties - - #region Methods - - private void Method() - { - } - - #endregion Methods - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSetOfRegions_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSetOfRegions_Cleaned.cs deleted file mode 100644 index 8c16516a2..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/Data/RemoveSetOfRegions_Cleaned.cs +++ /dev/null @@ -1,48 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove.Data -{ - internal class Regions - { - #region Fields - - private bool _field; - - #endregion Fields - - /* placeholder */ - /* placeholder */ - - #region Constructors - - public Regions() - { - - bool var1; - - bool var2; - - } - - #endregion Constructors - - /* placeholder */ - /* placeholder */ - - #region Properties - - public bool Property - { - get { return _field; } - set { _field = value; } - } - - #endregion Properties - - #region Methods - - private void Method() - { - } - - #endregion Methods - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/EndOfLineWhitespaceTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/EndOfLineWhitespaceTests.cs deleted file mode 100644 index c54ae3610..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/EndOfLineWhitespaceTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\EndOfLineWhitespace.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\EndOfLineWhitespace_Cleaned.cs", "Data")] - public class EndOfLineWhitespaceTests - { - #region Setup - - private static RemoveWhitespaceLogic _removeWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\EndOfLineWhitespace.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveEndOfLineWhitespace_CleansAsExpected() - { - Settings.Default.Cleaning_RemoveEndOfLineWhitespace = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveEndOfLineWhitespace, _projectItem, @"Data\EndOfLineWhitespace_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveEndOfLineWhitespace_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RemoveEndOfLineWhitespace = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveEndOfLineWhitespace, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveEndOfLineWhitespace_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RemoveEndOfLineWhitespace = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveEndOfLineWhitespace, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveEndOfLineWhitespace(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _removeWhitespaceLogic.RemoveEOLWhitespace(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/MultipleConsecutiveBlankLinesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/MultipleConsecutiveBlankLinesTests.cs deleted file mode 100644 index 563f6ab8f..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/MultipleConsecutiveBlankLinesTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\MultipleConsecutiveBlankLines.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\MultipleConsecutiveBlankLines_Cleaned.cs", "Data")] - public class MultipleConsecutiveBlankLinesTests - { - #region Setup - - private static RemoveWhitespaceLogic _removeWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\MultipleConsecutiveBlankLines.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveMultipleConsecutiveBlankLines_CleansAsExpected() - { - Settings.Default.Cleaning_RemoveMultipleConsecutiveBlankLines = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveMultipleConsecutiveBlankLines, _projectItem, @"Data\MultipleConsecutiveBlankLines_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveMultipleConsecutiveBlankLines_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RemoveMultipleConsecutiveBlankLines = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveMultipleConsecutiveBlankLines, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveMultipleConsecutiveBlankLines_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RemoveMultipleConsecutiveBlankLines = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveMultipleConsecutiveBlankLines, _projectItem); - } - - #endregion Tests - - #region Helpers - - private void RunRemoveMultipleConsecutiveBlankLines(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _removeWhitespaceLogic.RemoveMultipleConsecutiveBlankLines(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveAllRegionsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveAllRegionsTests.cs deleted file mode 100644 index e07a29c6c..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveAllRegionsTests.cs +++ /dev/null @@ -1,69 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\RemoveAllRegions.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\RemoveAllRegions_Cleaned.cs", "Data")] - public class RemoveAllRegionsTests - { - #region Setup - - private static RemoveRegionLogic _removeRegionLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeRegionLogic = RemoveRegionLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeRegionLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RemoveAllRegions.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveAllRegions_RunsAsExpected() - { - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveAllRegions, _projectItem, @"Data\RemoveAllRegions_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveAllRegions_DoesNothingOnSecondPass() - { - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveAllRegions, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveAllRegions(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _removeRegionLogic.RemoveRegions(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveCurrentRegionTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveCurrentRegionTests.cs deleted file mode 100644 index ba7815bb3..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveCurrentRegionTests.cs +++ /dev/null @@ -1,73 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\RemoveCurrentRegion.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\RemoveCurrentRegion_Cleaned.cs", "Data")] - public class RemoveCurrentRegionTests - { - #region Setup - - private static CodeModelHelper _codeModelHelper; - private static RemoveRegionLogic _removeRegionLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeModelHelper = CodeModelHelper.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeModelHelper); - - _removeRegionLogic = RemoveRegionLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeRegionLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RemoveCurrentRegion.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveCurrentRegion_RunsAsExpected() - { - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveCurrentRegion, _projectItem, @"Data\RemoveCurrentRegion_Cleaned.cs"); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveCurrentRegion(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - textDocument.Selection.MoveToLineAndOffset(18, 13); - Assert.AreEqual(textDocument.Selection.CurrentLine, 18); - - var region = _codeModelHelper.RetrieveCodeRegionUnderCursor(textDocument); - Assert.IsNotNull(region); - - _removeRegionLogic.RemoveRegion(region); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveEmptyRegionsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveEmptyRegionsTests.cs deleted file mode 100644 index a1f2fb7c1..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveEmptyRegionsTests.cs +++ /dev/null @@ -1,87 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using SteveCadwallader.CodeMaid.UI.Enumerations; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\RemoveEmptyRegions.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\RemoveEmptyRegions_Cleaned.cs", "Data")] - public class RemoveEmptyRegionsTests - { - #region Setup - - private static RemoveRegionLogic _removeRegionLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeRegionLogic = RemoveRegionLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeRegionLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RemoveEmptyRegions.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveEmptyRegions_RunsAsExpected() - { - Settings.Default.Cleaning_RemoveRegions = (int)NoneEmptyAll.Empty; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveEmptyRegions, _projectItem, @"Data\RemoveEmptyRegions_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveEmptyRegions_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RemoveRegions = (int)NoneEmptyAll.Empty; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveEmptyRegions, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveEmptyRegions_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RemoveRegions = (int)NoneEmptyAll.None; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveEmptyRegions, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveEmptyRegions(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var regions = codeItems.OfType().ToList(); - - _removeRegionLogic.RemoveRegionsPerSettings(regions); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveEndOfFileTrailingNewLineTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveEndOfFileTrailingNewLineTests.cs deleted file mode 100644 index dd768e6d5..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveEndOfFileTrailingNewLineTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\RemoveEndOfFileTrailingNewLine.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\RemoveEndOfFileTrailingNewLine_Cleaned.cs", "Data")] - public class RemoveEndOfFileTrailingNewLineTests - { - #region Setup - - private static RemoveWhitespaceLogic _removeWhitespaceLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeWhitespaceLogic = RemoveWhitespaceLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeWhitespaceLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RemoveEndOfFileTrailingNewLine.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveEndOfFileTrailingNewLine_CleansAsExpected() - { - Settings.Default.Cleaning_RemoveEndOfFileTrailingNewLine = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveEndOfFileTrailingNewLine, _projectItem, @"Data\RemoveEndOfFileTrailingNewLine_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveEndOfFileTrailingNewLine_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RemoveEndOfFileTrailingNewLine = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveEndOfFileTrailingNewLine, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveEndOfFileTrailingNewLine_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RemoveEndOfFileTrailingNewLine = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveEndOfFileTrailingNewLine, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveEndOfFileTrailingNewLine(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _removeWhitespaceLogic.RemoveEOFTrailingNewLine(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveSelectedRegionsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveSelectedRegionsTests.cs deleted file mode 100644 index 810b29353..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveSelectedRegionsTests.cs +++ /dev/null @@ -1,65 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\RemoveSelectedRegions.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\RemoveSelectedRegions_Cleaned.cs", "Data")] - public class RemoveSelectedRegionsTests - { - #region Setup - - private static RemoveRegionLogic _removeRegionLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeRegionLogic = RemoveRegionLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeRegionLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RemoveSelectedRegions.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveSelectedRegions_RunsAsExpected() - { - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveSelectedRegions, _projectItem, @"Data\RemoveSelectedRegions_Cleaned.cs"); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveSelectedRegions(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - textDocument.Selection.MoveToLineAndOffset(14, 9); - textDocument.Selection.MoveToLineAndOffset(45, 5, true); - - _removeRegionLogic.RemoveRegions(textDocument.Selection); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveSetOfRegionsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveSetOfRegionsTests.cs deleted file mode 100644 index 3b9e548a1..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Remove/RemoveSetOfRegionsTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Remove -{ - [TestClass] - [DeploymentItem(@"Cleaning\Remove\Data\RemoveSetOfRegions.cs", "Data")] - [DeploymentItem(@"Cleaning\Remove\Data\RemoveSetOfRegions_Cleaned.cs", "Data")] - public class RemoveSetOfRegionsTests - { - #region Setup - - private static RemoveRegionLogic _removeRegionLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _removeRegionLogic = RemoveRegionLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_removeRegionLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RemoveSetOfRegions.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveSetOfRegions_RunsAsExpected() - { - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveSetOfRegions, _projectItem, @"Data\RemoveSetOfRegions_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningRemoveSetOfRegions_DoesNothingOnSecondPass() - { - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveSetOfRegions, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveSetOfRegions(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var regions = codeItems.OfType().Where(x => x.Name == "In-Method region").ToList(); - - _removeRegionLogic.RemoveRegions(regions); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/AccessorsToBothBeSingleLineOrMultiLineTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/AccessorsToBothBeSingleLineOrMultiLineTests.cs deleted file mode 100644 index 5cc1c4553..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/AccessorsToBothBeSingleLineOrMultiLineTests.cs +++ /dev/null @@ -1,88 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\AccessorsToBothBeSingleLineOrMultiLine.cs", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\AccessorsToBothBeSingleLineOrMultiLine_Cleaned.cs", "Data")] - public class AccessorsToBothBeSingleLineOrMultiLineTests - { - #region Setup - - private static UpdateLogic _updateLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _updateLogic = UpdateLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_updateLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\AccessorsToBothBeSingleLineOrMultiLine.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateAccessorsToBothBeSingleLineOrMultiLine_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateAccessorsToBothBeSingleLineOrMultiLine = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateAccessorsToBothBeSingleLineOrMultiLine, _projectItem, @"Data\AccessorsToBothBeSingleLineOrMultiLine_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateAccessorsToBothBeSingleLineOrMultiLine_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateAccessorsToBothBeSingleLineOrMultiLine = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateAccessorsToBothBeSingleLineOrMultiLine, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateAccessorsToBothBeSingleLineOrMultiLine_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateAccessorsToBothBeSingleLineOrMultiLine = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateAccessorsToBothBeSingleLineOrMultiLine, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateAccessorsToBothBeSingleLineOrMultiLine(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var events = codeItems.OfType().ToList(); - var properties = codeItems.OfType().ToList(); - - _updateLogic.UpdateEventAccessorsToBothBeSingleLineOrMultiLine(events); - _updateLogic.UpdatePropertyAccessorsToBothBeSingleLineOrMultiLine(properties); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/AccessorsToBothBeSingleLineOrMultiLine.cs b/CodeMaid.IntegrationTests/Cleaning/Update/Data/AccessorsToBothBeSingleLineOrMultiLine.cs deleted file mode 100644 index d07333939..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/AccessorsToBothBeSingleLineOrMultiLine.cs +++ /dev/null @@ -1,162 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update.Data -{ - public class AccessorsToBothBeSingleLineOrMultiLine - { - private EventHandler _event; - private bool _field; - - public event EventHandler SingleLineEvent - { - add { _event += value; } - remove { _event -= value; } - } - - public event EventHandler SingleLineAdderSingleLineBodyRemover - { - add { _event += value; } - remove - { - _event -= value; - } - } - - public event EventHandler SingleLineAdderMultiLineBodyRemover - { - add { _event += value; } - remove - { - if (_event != null) - { - _event -= value; - } - } - } - - public event EventHandler MultiLineAdderSingleLineRemover - { - add - { - if (_event == null) - { - _event += value; - } - } - remove { _event -= value; } - } - - public event EventHandler MultiLineAdderSingleLineBodyRemover - { - add - { - if (_event == null) - { - _event += value; - } - } - remove - { - _event -= value; - } - } - - public event EventHandler MultiLineAdderMultiLineRemover - { - add - { - if (_event == null) - { - _event += value; - } - } - remove - { - if (_event != null) - { - _event -= value; - } - } - } - - public bool AutoImplementedProperty { get; set; } - - public bool SingleLineProperty - { - get { return _field; } - set { _field = value; } - } - - public bool SingleLineGetterSingleLineBodySetter - { - get { return _field; } - set - { - _field = value; - } - } - - public bool SingleLineGetterMultiLineBodySetter - { - get { return _field; } - set - { - if (_field != value) - { - _field = value; - } - } - } - - public bool MultiLineGetterSingleLineSetter - { - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - set { _field = value; } - } - - public bool MultiLineGetterSingleLineBodySetter - { - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - set - { - _field = value; - } - } - - public bool MultiLineGetterMultiLineSetter - { - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - set - { - if (_field != value) - { - _field = value; - } - } - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/AccessorsToBothBeSingleLineOrMultiLine_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Update/Data/AccessorsToBothBeSingleLineOrMultiLine_Cleaned.cs deleted file mode 100644 index c4f80c4c6..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/AccessorsToBothBeSingleLineOrMultiLine_Cleaned.cs +++ /dev/null @@ -1,168 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update.Data -{ - public class AccessorsToBothBeSingleLineOrMultiLine - { - private EventHandler _event; - private bool _field; - - public event EventHandler SingleLineEvent - { - add { _event += value; } - remove { _event -= value; } - } - - public event EventHandler SingleLineAdderSingleLineBodyRemover - { - add { _event += value; } - remove { _event -= value; } - } - - public event EventHandler SingleLineAdderMultiLineBodyRemover - { - add - { - _event += value; - } - remove - { - if (_event != null) - { - _event -= value; - } - } - } - - public event EventHandler MultiLineAdderSingleLineRemover - { - add - { - if (_event == null) - { - _event += value; - } - } - remove - { - _event -= value; - } - } - - public event EventHandler MultiLineAdderSingleLineBodyRemover - { - add - { - if (_event == null) - { - _event += value; - } - } - remove - { - _event -= value; - } - } - - public event EventHandler MultiLineAdderMultiLineRemover - { - add - { - if (_event == null) - { - _event += value; - } - } - remove - { - if (_event != null) - { - _event -= value; - } - } - } - - public bool AutoImplementedProperty { get; set; } - - public bool SingleLineProperty - { - get { return _field; } - set { _field = value; } - } - - public bool SingleLineGetterSingleLineBodySetter - { - get { return _field; } - set { _field = value; } - } - - public bool SingleLineGetterMultiLineBodySetter - { - get - { - return _field; - } - set - { - if (_field != value) - { - _field = value; - } - } - } - - public bool MultiLineGetterSingleLineSetter - { - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - set - { - _field = value; - } - } - - public bool MultiLineGetterSingleLineBodySetter - { - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - set - { - _field = value; - } - } - - public bool MultiLineGetterMultiLineSetter - { - get - { - if (_field == false) - { - _field = true; - } - - return _field; - } - set - { - if (_field != value) - { - _field = value; - } - } - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/EndRegionDirectives.cs b/CodeMaid.IntegrationTests/Cleaning/Update/Data/EndRegionDirectives.cs deleted file mode 100644 index eb82dae67..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/EndRegionDirectives.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update.Data -{ - public class EndRegionDirectives - { - #region Fields - - #endregion - - #region Constructors - - #endregion WrongEndRegion - - #region TopLevel - - #region NestedLevel1 - - #region NestedLevel2 - - #endregion - - #endregion - - #endregion - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/EndRegionDirectives_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Update/Data/EndRegionDirectives_Cleaned.cs deleted file mode 100644 index 996987693..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/EndRegionDirectives_Cleaned.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update.Data -{ - public class EndRegionDirectives - { - #region Fields - - #endregion Fields - - #region Constructors - - #endregion Constructors - - #region TopLevel - - #region NestedLevel1 - - #region NestedLevel2 - - #endregion NestedLevel2 - - #endregion NestedLevel1 - - #endregion TopLevel - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCPlusPlus.cpp b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCPlusPlus.cpp deleted file mode 100644 index 1577c4e3b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCPlusPlus.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "stdafx.h" \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCPlusPlus_Cleaned.cpp b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCPlusPlus_Cleaned.cpp deleted file mode 100644 index 888ad0dca..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCPlusPlus_Cleaned.cpp +++ /dev/null @@ -1,6 +0,0 @@ -//----------------------------------------------------------------------- -// -// Sample copyright. -// -//----------------------------------------------------------------------- -#include "stdafx.h" \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCSS.css b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCSS.css deleted file mode 100644 index 0e36810ad..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCSS.css +++ /dev/null @@ -1,3 +0,0 @@ -body -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCSS_Cleaned.css b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCSS_Cleaned.css deleted file mode 100644 index 415ad6ce3..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCSS_Cleaned.css +++ /dev/null @@ -1,4 +0,0 @@ -/* CSS Sample Copyright */ -body -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCSharp.cs b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCSharp.cs deleted file mode 100644 index 700e0c98e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCSharp.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update.Data -{ - public class FileHeaderCSharp - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCsharp_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCsharp_Cleaned.cs deleted file mode 100644 index 8d355da9f..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderCsharp_Cleaned.cs +++ /dev/null @@ -1,11 +0,0 @@ -//----------------------------------------------------------------------- -// -// Sample copyright. -// -//----------------------------------------------------------------------- -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update.Data -{ - public class FileHeaderCSharp - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderFSharp.fs b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderFSharp.fs deleted file mode 100644 index 6cd3571a0..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderFSharp.fs +++ /dev/null @@ -1,35 +0,0 @@ -module File1 - -#r "System.Transactions.dll" -open System -open System.Data -open System.Data.SqlClient - -// [snippet:Dynamic operator] -let (?) (reader:SqlDataReader) (name:string) : 'R = - let typ = typeof<'R> - if typ.IsGenericType && typ.GetGenericTypeDefinition() = typedefof> then - if reader.[name] = box DBNull.Value then - (box null) :?> 'R - else typ.GetMethod("Some").Invoke(null, [| reader.[name] |]) :?> 'R - else - reader.[name] :?> 'R -// [/snippet] - -// [snippet:Example] -let cstr = "Data Source=.\\SQLExpress;Initial Catalog=Northwind;Integrated Security=True" - -let printData() = - use conn = new SqlConnection(cstr) - conn.Open() - use cmd = new SqlCommand("SELECT * FROM [Products]", conn) - - printfn "10 Most Expensive Products\n==========================" - use reader = cmd.ExecuteReader() - while reader.Read() do - let name = reader?ProductName - let price = defaultArg reader?UnitPrice 0.0M - printfn "%s (%A)" name price - -printData() -// [/snippet] \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderFSharp_Cleaned.fs b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderFSharp_Cleaned.fs deleted file mode 100644 index f6fc88bb4..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderFSharp_Cleaned.fs +++ /dev/null @@ -1,36 +0,0 @@ -// FSharp Sample Copyright -module File1 - -#r "System.Transactions.dll" -open System -open System.Data -open System.Data.SqlClient - -// [snippet:Dynamic operator] -let (?) (reader:SqlDataReader) (name:string) : 'R = - let typ = typeof<'R> - if typ.IsGenericType && typ.GetGenericTypeDefinition() = typedefof> then - if reader.[name] = box DBNull.Value then - (box null) :?> 'R - else typ.GetMethod("Some").Invoke(null, [| reader.[name] |]) :?> 'R - else - reader.[name] :?> 'R -// [/snippet] - -// [snippet:Example] -let cstr = "Data Source=.\\SQLExpress;Initial Catalog=Northwind;Integrated Security=True" - -let printData() = - use conn = new SqlConnection(cstr) - conn.Open() - use cmd = new SqlCommand("SELECT * FROM [Products]", conn) - - printfn "10 Most Expensive Products\n==========================" - use reader = cmd.ExecuteReader() - while reader.Read() do - let name = reader?ProductName - let price = defaultArg reader?UnitPrice 0.0M - printfn "%s (%A)" name price - -printData() -// [/snippet] \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderHTML.html b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderHTML.html deleted file mode 100644 index ac2c6541c..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderHTML.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderHTML_Cleaned.html b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderHTML_Cleaned.html deleted file mode 100644 index 755f822ea..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderHTML_Cleaned.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJSON.json b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJSON.json deleted file mode 100644 index 5f282702b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJSON.json +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJSON_Cleaned.json b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJSON_Cleaned.json deleted file mode 100644 index 8593c62d9..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJSON_Cleaned.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJavaScript.js b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJavaScript.js deleted file mode 100644 index 4fcb3ea15..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJavaScript.js +++ /dev/null @@ -1,19 +0,0 @@ -var Shapes; -(function (Shapes) { - - var Point = Shapes.Point = (function () { - function Point(x, y) { - this.x = x; - this.y = y; - } - Point.prototype.getDist = function () { - return Math.sqrt((this.x * this.x) + (this.y * this.y)); - }; - Point.origin = new Point(0, 0); - return Point; - })(); - -})(Shapes || (Shapes = {})); - -var p = new Shapes.Point(3, 4); -var dist = p.getDist(); diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJavaScript_Cleaned.js b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJavaScript_Cleaned.js deleted file mode 100644 index 2d39c4c37..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderJavaScript_Cleaned.js +++ /dev/null @@ -1,21 +0,0 @@ -// JavaScript Sample Copyright - -var Shapes; -(function (Shapes) { - - var Point = Shapes.Point = (function () { - function Point(x, y) { - this.x = x; - this.y = y; - } - Point.prototype.getDist = function () { - return Math.sqrt((this.x * this.x) + (this.y * this.y)); - }; - Point.origin = new Point(0, 0); - return Point; - })(); - -})(Shapes || (Shapes = {})); - -var p = new Shapes.Point(3, 4); -var dist = p.getDist(); diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderLESS.less b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderLESS.less deleted file mode 100644 index 0e36810ad..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderLESS.less +++ /dev/null @@ -1,3 +0,0 @@ -body -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderLESS_Cleaned.less b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderLESS_Cleaned.less deleted file mode 100644 index 2aaeca092..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderLESS_Cleaned.less +++ /dev/null @@ -1,4 +0,0 @@ -/* LESS Sample Copyright */ -body -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPHP.php b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPHP.php deleted file mode 100644 index bbd492ce8..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPHP.php +++ /dev/null @@ -1,35 +0,0 @@ -class Foo -{ - /** - * This is a text field - * @var string - */ - private $text; - - public function __construct() - { - $this->text = "sample"; - } - - /** - * Get the text field. - * @return string The text field. - */ - public function getText() - { - return $this->text; - } - - - - /** - * Set the text field. - * @param string $text - */ - public function setText($text) - { - $this->text = $text; - - } - -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPHP_Cleaned.php b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPHP_Cleaned.php deleted file mode 100644 index 0d946951e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPHP_Cleaned.php +++ /dev/null @@ -1,40 +0,0 @@ -text = "sample"; - } - - /** - * Get the text field. - * @return string The text field. - */ - public function getText() - { - return $this->text; - } - - - - /** - * Set the text field. - * @param string $text - */ - public function setText($text) - { - $this->text = $text; - - } - -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPowerShell.ps1 b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPowerShell.ps1 deleted file mode 100644 index 4935ad7c5..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPowerShell.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -# -# PowerShell.ps1 -# diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPowerShell_Cleaned.ps1 b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPowerShell_Cleaned.ps1 deleted file mode 100644 index 4b889af95..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderPowerShell_Cleaned.ps1 +++ /dev/null @@ -1,4 +0,0 @@ -# PowerShell Sample Copyright -# -# PowerShell.ps1 -# diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderR.R b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderR.R deleted file mode 100644 index 5f4db9e62..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderR.R +++ /dev/null @@ -1,3 +0,0 @@ -# -# FileHeaderR.R -# diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderR_Cleaned.R b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderR_Cleaned.R deleted file mode 100644 index b52cdb441..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderR_Cleaned.R +++ /dev/null @@ -1,4 +0,0 @@ -# R Sample Copyright -# -# FileHeaderR.R -# diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderSCSS.scss b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderSCSS.scss deleted file mode 100644 index 46800d16a..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderSCSS.scss +++ /dev/null @@ -1,2 +0,0 @@ -body { -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderSCSS_Cleaned.scss b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderSCSS_Cleaned.scss deleted file mode 100644 index 24244605e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderSCSS_Cleaned.scss +++ /dev/null @@ -1,3 +0,0 @@ -/* SCSS Sample Copyright */ -body { -} diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderTypeScript.ts b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderTypeScript.ts deleted file mode 100644 index 319ec95a2..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderTypeScript.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Interface -interface IPoint { - getDist(): number; -} - -// Module -module Shapes { - - // Class - export class Point implements IPoint { - // Constructor - constructor (public x: number, public y: number) { } - - // Instance member - getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } - - // Static member - static origin = new Point(0, 0); - } - -} - -// Local variables -var p: IPoint = new Shapes.Point(3, 4); -var dist = p.getDist(); \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderTypeScript_Cleaned.ts b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderTypeScript_Cleaned.ts deleted file mode 100644 index e59112f8c..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderTypeScript_Cleaned.ts +++ /dev/null @@ -1,27 +0,0 @@ -// TypeScript Sample Copyright - -// Interface -interface IPoint { - getDist(): number; -} - -// Module -module Shapes { - - // Class - export class Point implements IPoint { - // Constructor - constructor (public x: number, public y: number) { } - - // Instance member - getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } - - // Static member - static origin = new Point(0, 0); - } - -} - -// Local variables -var p: IPoint = new Shapes.Point(3, 4); -var dist = p.getDist(); \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderVisualBasic.vb b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderVisualBasic.vb deleted file mode 100644 index 086d7306f..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderVisualBasic.vb +++ /dev/null @@ -1,30 +0,0 @@ -Module Module1 - Public Sub RoundNumber(ByRef RoundN, _ - Optional Decimals As Integer) - On Error Resume Next - Dim RoundAmount As Single, Result - 'Creates powers to the decimal places - RoundAmount = 10 ^ Decimals - 'Creates a whole number, rounds, applies decimal places - Result = (CLng((RoundN) * RoundAmount) / RoundAmount) - RoundN = Result - End Sub - - ' - ' Calculates age in years from a given date to today's date. - ' - ' - - Function Age(varBirthDate As Object) As Integer - - Dim varAge As Object - If Not IsDate(varBirthDate) Then Exit Function - varAge = DateDiff("yyyy", varBirthDate, Now) - If Date < DateSerial(Year(Now), Month(varBirthDate), _ - Day(varBirthDate)) Then - varAge = varAge - 1 - End If - Age = CInt(varAge) - - End Function -End Module \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderVisualBasic_Cleaned.vb b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderVisualBasic_Cleaned.vb deleted file mode 100644 index 6bd7ac63a..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderVisualBasic_Cleaned.vb +++ /dev/null @@ -1,32 +0,0 @@ -' Visual Basic Sample Copyright - -Module Module1 - Public Sub RoundNumber(ByRef RoundN, _ - Optional Decimals As Integer) - On Error Resume Next - Dim RoundAmount As Single, Result - 'Creates powers to the decimal places - RoundAmount = 10 ^ Decimals - 'Creates a whole number, rounds, applies decimal places - Result = (CLng((RoundN) * RoundAmount) / RoundAmount) - RoundN = Result - End Sub - - ' - ' Calculates age in years from a given date to today's date. - ' - ' - - Function Age(varBirthDate As Object) As Integer - - Dim varAge As Object - If Not IsDate(varBirthDate) Then Exit Function - varAge = DateDiff("yyyy", varBirthDate, Now) - If Date < DateSerial(Year(Now), Month(varBirthDate), _ - Day(varBirthDate)) Then - varAge = varAge - 1 - End If - Age = CInt(varAge) - - End Function -End Module \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXAML.xaml b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXAML.xaml deleted file mode 100644 index 42f1cd18c..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXAML.xaml +++ /dev/null @@ -1,3 +0,0 @@ - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXAML_Cleaned.xaml b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXAML_Cleaned.xaml deleted file mode 100644 index b7d09a8f8..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXAML_Cleaned.xaml +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXML.xml b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXML.xml deleted file mode 100644 index 47d08a5ec..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXML.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXML_Cleaned.xml b/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXML_Cleaned.xml deleted file mode 100644 index 6db91e31b..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/FileHeaderXML_Cleaned.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/SingleLineMethods.cs b/CodeMaid.IntegrationTests/Cleaning/Update/Data/SingleLineMethods.cs deleted file mode 100644 index 3520101f4..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/SingleLineMethods.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update.Data -{ - public abstract class SingleLineMethods - { - public void Method() { } - - public void Method2() { /* With comment */ } - - public void Method3() { if (true) { } } - - // Abstract methods are a single line, but do not have a body so should not be affected. - public abstract void AbstractMethod(); - } - - public interface ISingleLineMethods - { - // Interface methods are a single line, but do not have a body so should not be affected. - void Method(); - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/Data/SingleLineMethods_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/Update/Data/SingleLineMethods_Cleaned.cs deleted file mode 100644 index 54f3f05b0..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/Data/SingleLineMethods_Cleaned.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update.Data -{ - public abstract class SingleLineMethods - { - public void Method() - { - } - - public void Method2() - { - /* With comment */ - } - - public void Method3() - { - if (true) { } - } - - // Abstract methods are a single line, but do not have a body so should not be affected. - public abstract void AbstractMethod(); - } - - public interface ISingleLineMethods - { - // Interface methods are a single line, but do not have a body so should not be affected. - void Method(); - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/EndRegionDirectivesTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/EndRegionDirectivesTests.cs deleted file mode 100644 index a18436180..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/EndRegionDirectivesTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\EndRegionDirectives.cs", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\EndRegionDirectives_Cleaned.cs", "Data")] - public class EndRegionDirectivesTests - { - #region Setup - - private static UpdateLogic _updateLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _updateLogic = UpdateLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_updateLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\EndRegionDirectives.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateEndRegionDirectives_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateEndRegionDirectives = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateEndRegionDirectives, _projectItem, @"Data\EndRegionDirectives_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateEndRegionDirectives_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateEndRegionDirectives = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateEndRegionDirectives, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateEndRegionDirectives_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateEndRegionDirectives = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateEndRegionDirectives, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateEndRegionDirectives(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _updateLogic.UpdateEndRegionDirectives(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderCPlusPlusTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderCPlusPlusTests.cs deleted file mode 100644 index 3892792ef..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderCPlusPlusTests.cs +++ /dev/null @@ -1,93 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderCPlusPlus.cpp", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderCPlusPlus_Cleaned.cpp", "Data")] - public class FileHeaderCPlusPlusTests - { - #region Setup - - private static FileHeaderLogic _fileHeaderLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _fileHeaderLogic = FileHeaderLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_fileHeaderLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\FileHeaderCPlusPlus.cpp"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderCPlusPlus_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateFileHeaderCPlusPlus = -@"//----------------------------------------------------------------------- -// -// Sample copyright. -// -//-----------------------------------------------------------------------"; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateFileHeader, _projectItem, @"Data\FileHeaderCPlusPlus_Cleaned.cpp"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderCPlusPlus_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateFileHeaderCPlusPlus = -@"//----------------------------------------------------------------------- -// -// Sample copyright. -// -//-----------------------------------------------------------------------"; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateFileHeader, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderCPlusPlus_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateFileHeaderCPlusPlus = null; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateFileHeader, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateFileHeader(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _fileHeaderLogic.UpdateFileHeader(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderCSSTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderCSSTests.cs deleted file mode 100644 index 11699c827..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderCSSTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderCSS.css", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderCSS_Cleaned.css", "Data")] - public class FileHeaderCSSTests - { - #region Setup - - private static FileHeaderLogic _fileHeaderLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _fileHeaderLogic = FileHeaderLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_fileHeaderLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\FileHeaderCSS.css"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderCSS_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateFileHeaderCSS = @"/* CSS Sample Copyright */"; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateFileHeader, _projectItem, @"Data\FileHeaderCSS_Cleaned.css"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderCSS_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateFileHeaderCSS = @"/* CSS Sample Copyright */"; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateFileHeader, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderCSS_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateFileHeaderCSS = null; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateFileHeader, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateFileHeader(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _fileHeaderLogic.UpdateFileHeader(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderCSharpTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderCSharpTests.cs deleted file mode 100644 index 5816a1e89..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderCSharpTests.cs +++ /dev/null @@ -1,93 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderCSharp.cs", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderCSharp_Cleaned.cs", "Data")] - public class FileHeaderCSharpTests - { - #region Setup - - private static FileHeaderLogic _fileHeaderLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _fileHeaderLogic = FileHeaderLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_fileHeaderLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\FileHeaderCSharp.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderCSharp_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateFileHeaderCSharp = -@"//----------------------------------------------------------------------- -// -// Sample copyright. -// -//-----------------------------------------------------------------------"; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateFileHeader, _projectItem, @"Data\FileHeaderCSharp_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderCSharp_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateFileHeaderCSharp = -@"//----------------------------------------------------------------------- -// -// Sample copyright. -// -//-----------------------------------------------------------------------"; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateFileHeader, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderCSharp_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateFileHeaderCSharp = null; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateFileHeader, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateFileHeader(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _fileHeaderLogic.UpdateFileHeader(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderFSharpTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderFSharpTests.cs deleted file mode 100644 index 72361b050..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderFSharpTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderFSharp.fs", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderFSharp_Cleaned.fs", "Data")] - public class FileHeaderFSharpTests - { - #region Setup - - private static FileHeaderLogic _fileHeaderLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _fileHeaderLogic = FileHeaderLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_fileHeaderLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\FileHeaderFSharp.fs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderFSharp_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateFileHeaderFSharp = @"// FSharp Sample Copyright"; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateFileHeader, _projectItem, @"Data\FileHeaderFSharp_Cleaned.fs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderFSharp_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateFileHeaderFSharp = @"// FSharp Sample Copyright"; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateFileHeader, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderFSharp_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateFileHeaderFSharp = null; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateFileHeader, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateFileHeader(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _fileHeaderLogic.UpdateFileHeader(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderHTMLTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderHTMLTests.cs deleted file mode 100644 index 04495624e..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderHTMLTests.cs +++ /dev/null @@ -1,87 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderHTML.html", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderHTML_Cleaned.html", "Data")] - public class FileHeaderHTMLTests - { - #region Setup - - private static FileHeaderLogic _fileHeaderLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _fileHeaderLogic = FileHeaderLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_fileHeaderLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\FileHeaderHTML.html"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderHTML_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateFileHeaderHTML = -@" -"; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateFileHeader, _projectItem, @"Data\FileHeaderHTML_Cleaned.html"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderHTML_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateFileHeaderHTML = -@" -"; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateFileHeader, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderHTML_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateFileHeaderHTML = null; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateFileHeader, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateFileHeader(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _fileHeaderLogic.UpdateFileHeader(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderJSONTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderJSONTests.cs deleted file mode 100644 index 6dbe8c02c..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderJSONTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderJSON.json", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderJSON_Cleaned.json", "Data")] - public class FileHeaderJSONTests - { - #region Setup - - private static FileHeaderLogic _fileHeaderLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _fileHeaderLogic = FileHeaderLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_fileHeaderLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\FileHeaderJSON.json"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderJSON_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateFileHeaderJSON = "{"; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateFileHeader, _projectItem, @"Data\FileHeaderJSON_Cleaned.json"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderJSON_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateFileHeaderJSON = "{"; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateFileHeader, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderJSON_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateFileHeaderJSON = null; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateFileHeader, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateFileHeader(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _fileHeaderLogic.UpdateFileHeader(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderJavaScriptTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderJavaScriptTests.cs deleted file mode 100644 index 37d974063..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderJavaScriptTests.cs +++ /dev/null @@ -1,87 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderJavaScript.js", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderJavaScript_Cleaned.js", "Data")] - public class FileHeaderJavaScriptTests - { - #region Setup - - private static FileHeaderLogic _fileHeaderLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _fileHeaderLogic = FileHeaderLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_fileHeaderLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\FileHeaderJavaScript.js"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderJavaScript_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateFileHeaderJavaScript = -@"// JavaScript Sample Copyright -"; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateFileHeader, _projectItem, @"Data\FileHeaderJavaScript_Cleaned.js"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderJavaScript_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateFileHeaderJavaScript = -@"// JavaScript Sample Copyright -"; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateFileHeader, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderJavaScript_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateFileHeaderJavaScript = null; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateFileHeader, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateFileHeader(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _fileHeaderLogic.UpdateFileHeader(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderLESSTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderLESSTests.cs deleted file mode 100644 index da118ca90..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderLESSTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderLESS.less", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderLESS_Cleaned.less", "Data")] - public class FileHeaderLESSTests - { - #region Setup - - private static FileHeaderLogic _fileHeaderLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _fileHeaderLogic = FileHeaderLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_fileHeaderLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\FileHeaderLESS.less"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderLESS_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateFileHeaderLESS = @"/* LESS Sample Copyright */"; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateFileHeader, _projectItem, @"Data\FileHeaderLESS_Cleaned.less"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderLESS_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateFileHeaderLESS = @"/* LESS Sample Copyright */"; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateFileHeader, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderLESS_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateFileHeaderLESS = null; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateFileHeader, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateFileHeader(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _fileHeaderLogic.UpdateFileHeader(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderPHPTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderPHPTests.cs deleted file mode 100644 index 7adc170f6..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderPHPTests.cs +++ /dev/null @@ -1,92 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [Ignore] - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderPHP.php", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderPHP_Cleaned.php", "Data")] - public class FileHeaderPHPTests - { - #region Setup - - private static FileHeaderLogic _fileHeaderLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _fileHeaderLogic = FileHeaderLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_fileHeaderLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\FileHeaderPHP.php"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderPHP_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateFileHeaderPHP = -@""; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateFileHeader, _projectItem, @"Data\FileHeaderXAML_Cleaned.xaml"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderXAML_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateFileHeaderXAML = @""; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateFileHeader, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderXAML_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateFileHeaderXAML = null; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateFileHeader, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateFileHeader(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _fileHeaderLogic.UpdateFileHeader(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderXMLTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderXMLTests.cs deleted file mode 100644 index 48f09b5bd..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/FileHeaderXMLTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderXML.xml", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\FileHeaderXML_Cleaned.xml", "Data")] - public class FileHeaderXMLTests - { - #region Setup - - private static FileHeaderLogic _fileHeaderLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _fileHeaderLogic = FileHeaderLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_fileHeaderLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\FileHeaderXML.xml"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderXML_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateFileHeaderXML = @""; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateFileHeader, _projectItem, @"Data\FileHeaderXML_Cleaned.xml"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderXML_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateFileHeaderXML = @""; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateFileHeader, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateFileHeaderXML_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateFileHeaderXML = null; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateFileHeader, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateFileHeader(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _fileHeaderLogic.UpdateFileHeader(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/Update/SingleLineMethodsTests.cs b/CodeMaid.IntegrationTests/Cleaning/Update/SingleLineMethodsTests.cs deleted file mode 100644 index db1173646..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/Update/SingleLineMethodsTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Model.CodeItems; -using SteveCadwallader.CodeMaid.Properties; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.Update -{ - [TestClass] - [DeploymentItem(@"Cleaning\Update\Data\SingleLineMethods.cs", "Data")] - [DeploymentItem(@"Cleaning\Update\Data\SingleLineMethods_Cleaned.cs", "Data")] - public class SingleLineMethodsTests - { - #region Setup - - private static UpdateLogic _updateLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _updateLogic = UpdateLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_updateLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\SingleLineMethods.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateSingleLineMethods_CleansAsExpected() - { - Settings.Default.Cleaning_UpdateSingleLineMethods = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunUpdateSingleLineMethods, _projectItem, @"Data\SingleLineMethods_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateSingleLineMethods_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_UpdateSingleLineMethods = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunUpdateSingleLineMethods, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningUpdateSingleLineMethods_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_UpdateSingleLineMethods = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunUpdateSingleLineMethods, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunUpdateSingleLineMethods(Document document) - { - var codeItems = TestOperations.CodeModelManager.RetrieveAllCodeItems(document); - var methods = codeItems.OfType().ToList(); - - _updateLogic.UpdateSingleLineMethods(methods); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/ReinsertAfterRemoveUnusedUsingStatements.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/ReinsertAfterRemoveUnusedUsingStatements.cs deleted file mode 100644 index 58dfb59c9..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/ReinsertAfterRemoveUnusedUsingStatements.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio.Data -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/ReinsertAfterRemoveUnusedUsingStatements_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/ReinsertAfterRemoveUnusedUsingStatements_Cleaned.cs deleted file mode 100644 index 4f517cc60..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/ReinsertAfterRemoveUnusedUsingStatements_Cleaned.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System; -using System.Linq; -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio.Data -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements.cs deleted file mode 100644 index d85b0c6eb..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio.Data -{ - public class Class - { - public String String { get; set; } - public StringBuilder StringBuilder { get; set; } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements_Cleaned.cs deleted file mode 100644 index ab2b82477..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements_Cleaned.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Text; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio.Data -{ - public class Class - { - public String String { get; set; } - public StringBuilder StringBuilder { get; set; } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/ReinsertAfterRemoveUnusedUsingStatementsTests.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/ReinsertAfterRemoveUnusedUsingStatementsTests.cs deleted file mode 100644 index eedbe2b1c..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/ReinsertAfterRemoveUnusedUsingStatementsTests.cs +++ /dev/null @@ -1,75 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.Helpers; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio -{ - [TestClass] - [DeploymentItem(@"Cleaning\VisualStudio\Data\ReinsertAfterRemoveUnusedUsingStatements.cs", "Data")] - [DeploymentItem(@"Cleaning\VisualStudio\Data\ReinsertAfterRemoveUnusedUsingStatements_Cleaned.cs", "Data")] - public class ReinsertAfterRemoveUnusedUsingStatementsTests - { - #region Setup - - private static UsingStatementCleanupLogic _usingStatementCleanupLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _usingStatementCleanupLogic = UsingStatementCleanupLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_usingStatementCleanupLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\ReinsertAfterRemoveUnusedUsingStatements.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningVisualStudioReinsertAfterRemoveUnusedUsingStatements_RunsAsExpected() - { - Settings.Default.Cleaning_RunVisualStudioRemoveAndSortUsingStatements = true; - Settings.Default.Cleaning_UsingStatementsToReinsertWhenRemovedExpression = "using System;||using System.Linq;"; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveUnusedUsingStatements, _projectItem, @"Data\ReinsertAfterRemoveUnusedUsingStatements_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningVisualStudioReinsertAfterRemoveUnusedUsingStatements_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RunVisualStudioRemoveAndSortUsingStatements = false; - Settings.Default.Cleaning_UsingStatementsToReinsertWhenRemovedExpression = "using System;||using System.Linq;"; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveUnusedUsingStatements, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveUnusedUsingStatements(Document document) - { - _usingStatementCleanupLogic.RemoveAndSortUsingStatements(document.GetTextDocument()); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/RemoveAndSortUsingStatementsTests.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/RemoveAndSortUsingStatementsTests.cs deleted file mode 100644 index bb49da418..000000000 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/RemoveAndSortUsingStatementsTests.cs +++ /dev/null @@ -1,82 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.Helpers; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio -{ - [TestClass] - [DeploymentItem(@"Cleaning\VisualStudio\Data\RemoveAndSortUsingStatements.cs", "Data")] - [DeploymentItem(@"Cleaning\VisualStudio\Data\RemoveAndSortUsingStatements_Cleaned.cs", "Data")] - public class RemoveAndSortUsingStatementsTests - { - #region Setup - - private static UsingStatementCleanupLogic _usingStatementCleanupLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _usingStatementCleanupLogic = UsingStatementCleanupLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_usingStatementCleanupLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RemoveAndSortUsingStatements.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningVisualStudioRemoveAndSortUsingStatements_RunsAsExpected() - { - Settings.Default.Cleaning_RunVisualStudioRemoveAndSortUsingStatements = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveAndSortUsingStatements, _projectItem, @"Data\RemoveAndSortUsingStatements_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningVisualStudioRemoveAndSortUsingStatements_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RunVisualStudioRemoveAndSortUsingStatements = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveAndSortUsingStatements, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningVisualStudioRemoveAndSortUsingStatements_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RunVisualStudioRemoveAndSortUsingStatements = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveAndSortUsingStatements, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunRemoveAndSortUsingStatements(Document document) - { - _usingStatementCleanupLogic.RemoveAndSortUsingStatements(document.GetTextDocument()); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj b/CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj deleted file mode 100644 index ed67cf5e8..000000000 --- a/CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj +++ /dev/null @@ -1,984 +0,0 @@ - - - - Debug - AnyCPU - 15.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - {756CCDA3-D5E9-44B8-8049-1317B1826776} - Library - Properties - SteveCadwallader.CodeMaid.IntegrationTests - SteveCadwallader.CodeMaid.IntegrationTests - True - ..\CodeMaid.snk - v4.7.2 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - latest - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - False - - - False - - - False - - - False - - - ..\packages\Microsoft.VisualStudio.CoreUtility.15.8.525\lib\net46\Microsoft.VisualStudio.CoreUtility.dll - - - ..\packages\Microsoft.VisualStudio.ImageCatalog.15.9.28307\lib\net45\Microsoft.VisualStudio.ImageCatalog.dll - - - ..\packages\Microsoft.VisualStudio.Imaging.15.9.28307\lib\net45\Microsoft.VisualStudio.Imaging.dll - - - ..\packages\Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.14.3.26930\lib\net20\Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll - True - - - ..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6071\lib\Microsoft.VisualStudio.OLE.Interop.dll - - - ..\packages\VS.QualityTools.UnitTestFramework.15.0.27323.2\lib\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll - - - ..\packages\Microsoft.VisualStudio.Shell.15.0.15.9.28307\lib\net45\Microsoft.VisualStudio.Shell.15.0.dll - - - ..\packages\Microsoft.VisualStudio.Shell.Framework.15.9.28307\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll - - - ..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6072\lib\net11\Microsoft.VisualStudio.Shell.Interop.dll - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30320\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61031\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.12.0.12.0.30111\lib\net20\Microsoft.VisualStudio.Shell.Interop.12.0.dll - True - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.14.3.26929\lib\net20\Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.dll - True - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.15.0.26929\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.dll - True - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime.15.6.27413\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime.dll - True - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50728\lib\net11\Microsoft.VisualStudio.Shell.Interop.8.0.dll - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30730\lib\net11\Microsoft.VisualStudio.Shell.Interop.9.0.dll - - - ..\packages\Microsoft.VisualStudio.Text.Data.15.8.525\lib\net46\Microsoft.VisualStudio.Text.Data.dll - - - ..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6071\lib\net11\Microsoft.VisualStudio.TextManager.Interop.dll - - - ..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50728\lib\net11\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - - - ..\packages\Microsoft.VisualStudio.Threading.15.8.209\lib\net46\Microsoft.VisualStudio.Threading.dll - - - ..\packages\Microsoft.VisualStudio.Utilities.15.9.28307\lib\net46\Microsoft.VisualStudio.Utilities.dll - - - ..\packages\Microsoft.VisualStudio.Validation.15.3.58\lib\net45\Microsoft.VisualStudio.Validation.dll - - - - ..\packages\Microsoft.VSSDK.UnitTestLibrary.14.3.25407\lib\net45\Microsoft.VSSDK.UnitTestLibrary.dll - - - ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll - - - - False - - - ..\packages\StreamJsonRpc.1.3.23\lib\net45\StreamJsonRpc.dll - - - - - - - ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll - - - - - - Properties\GlobalAssemblyInfo.cs - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - TypeScript.ts - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - PreserveNewest - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - PreserveNewest - - - PreserveNewest - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - {19b1ab9e-4603-4a9c-9284-32aae57fb7bc} - CodeMaid - - - - - Properties\CodeMaid.snk - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - Designer - MSBuild:Compile - PreserveNewest - - - - - PreserveNewest - - - - - PreserveNewest - - - - - PreserveNewest - - - - - PreserveNewest - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/DialogTests.cs b/CodeMaid.IntegrationTests/DialogTests.cs deleted file mode 100644 index c11b4574b..000000000 --- a/CodeMaid.IntegrationTests/DialogTests.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using System; -using System.ComponentModel.Design; - -namespace SteveCadwallader.CodeMaid.IntegrationTests -{ - [TestClass] - public class DialogTests - { - [TestMethod] - [HostType("VS IDE")] - public void ShowAboutTest() - { - UIThreadInvoker.Invoke(new Action(() => - { - var dialogBoxPurger = new DialogBoxPurger(NativeMethods.IDOK); - - try - { - dialogBoxPurger.Start(); - - var aboutCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidAbout); - TestUtils.ExecuteCommand(aboutCommand); - } - finally - { - dialogBoxPurger.WaitForDialogThreadToTerminate(); - } - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void ShowConfigurationTest() - { - UIThreadInvoker.Invoke(new Action(() => - { - var dialogBoxPurger = new DialogBoxPurger(NativeMethods.IDOK); - - try - { - dialogBoxPurger.Start(); - - var configurationCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidOptions); - TestUtils.ExecuteCommand(configurationCommand); - } - finally - { - dialogBoxPurger.WaitForDialogThreadToTerminate(); - } - })); - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Formatting/BaseCommentFormatTests.cs b/CodeMaid.IntegrationTests/Formatting/BaseCommentFormatTests.cs deleted file mode 100644 index d7136d618..000000000 --- a/CodeMaid.IntegrationTests/Formatting/BaseCommentFormatTests.cs +++ /dev/null @@ -1,76 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Formatting; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Formatting -{ - /// - /// A base class implementing common logic for comment formatting unit tests. - /// - public abstract class BaseCommentFormatTests - { - #region Setup - - private static CommentFormatLogic _commentFormatLogic; - private ProjectItem _projectItem; - - protected abstract string TestBaseFileName { get; } - - public static void ClassInitialize(TestContext testContext) - { - _commentFormatLogic = CommentFormatLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_commentFormatLogic); - } - - public virtual void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject($@"Data\{TestBaseFileName}.cs"); - } - - public virtual void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - protected void FormatsAsExpected() - { - Settings.Default.Formatting_CommentRunDuringCleanup = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunFormatComments, _projectItem, $@"Data\{TestBaseFileName}_Formatted.cs"); - } - - protected void DoesNothingOnSecondPass() - { - Settings.Default.Formatting_CommentRunDuringCleanup = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunFormatComments, _projectItem); - } - - protected void DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Formatting_CommentRunDuringCleanup = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunFormatComments, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunFormatComments(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - - _commentFormatLogic.FormatComments(textDocument); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Formatting/Data/StandardCommentFormat.cs b/CodeMaid.IntegrationTests/Formatting/Data/StandardCommentFormat.cs deleted file mode 100644 index e6fed23c4..000000000 --- a/CodeMaid.IntegrationTests/Formatting/Data/StandardCommentFormat.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Runtime.Serialization; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Formatting.Data -{ - [DataContract(Name = "SecurityContext", Namespace = "http://schemas.datacontract.org/2004/07/Example")] - public class StandardCommentFormat - { - // This is a traditional comment that started on column nine and will go on to column one hundred and twenty three. - - //This comment has no space after the comment prefix, so it should be treated as code and ignored instead of formatted. - - // This comment is led with tabs instead of spaces and it is expected that this line keeps its formatting and following ones are defined by VS settings. - - public void Method() - { - string s = "This is a string that includes the comment prefix // but it should not trigger any re-formatting."; - } - - ////public void CommentedOutMethod() - ////{ - //// string[] array = new string[0]; - - //// foreach (var item in array) - //// { - //// Console.WriteLine("Test"); - //// } - ////} - - // This comment would only have a single word to wrap, which is wasteful and should be ignored. - - //// List: - //// 1) item one - //// 2) item two - - //// var buffer = input as object[]; - //// if (buffer != null) - //// { - //// Console.WriteLine("some example code"); - //// } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Formatting/Data/StandardCommentFormat_Formatted.cs b/CodeMaid.IntegrationTests/Formatting/Data/StandardCommentFormat_Formatted.cs deleted file mode 100644 index 256c54063..000000000 --- a/CodeMaid.IntegrationTests/Formatting/Data/StandardCommentFormat_Formatted.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Runtime.Serialization; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Formatting.Data -{ - [DataContract(Name = "SecurityContext", Namespace = "http://schemas.datacontract.org/2004/07/Example")] - public class StandardCommentFormat - { - // This is a traditional comment that started on column nine and will go on to column one - // hundred and twenty three. - - //This comment has no space after the comment prefix, so it should be treated as code and ignored instead of formatted. - - // This comment is led with tabs instead of spaces and it is expected that this line keeps - // its formatting and following ones are defined by VS settings. - - public void Method() - { - string s = "This is a string that includes the comment prefix // but it should not trigger any re-formatting."; - } - - ////public void CommentedOutMethod() - ////{ - //// string[] array = new string[0]; - - //// foreach (var item in array) - //// { - //// Console.WriteLine("Test"); - //// } - ////} - - // This comment would only have a single word to wrap, which is wasteful and should be ignored. - - //// List: - //// 1) item one - //// 2) item two - - //// var buffer = input as object[]; - //// if (buffer != null) - //// { - //// Console.WriteLine("some example code"); - //// } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Formatting/Data/StyleCopHeaderFormat.cs b/CodeMaid.IntegrationTests/Formatting/Data/StyleCopHeaderFormat.cs deleted file mode 100644 index 7a8176846..000000000 --- a/CodeMaid.IntegrationTests/Formatting/Data/StyleCopHeaderFormat.cs +++ /dev/null @@ -1,14 +0,0 @@ -// -// Copyright (c) 2015 CompanyName. All rights reserved. -// -// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque convallis non leo nec mollis. Vestibulum ac tortor tincidunt, vestibulum nunc in, egestas arcu. - -using System.Runtime.Serialization; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Formatting.Data -{ - public class StyleCopHeaderFormat - { - - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Formatting/Data/StyleCopHeaderFormat_Formatted.cs b/CodeMaid.IntegrationTests/Formatting/Data/StyleCopHeaderFormat_Formatted.cs deleted file mode 100644 index e0b4b425b..000000000 --- a/CodeMaid.IntegrationTests/Formatting/Data/StyleCopHeaderFormat_Formatted.cs +++ /dev/null @@ -1,17 +0,0 @@ -// -// Copyright (c) 2015 CompanyName. All rights reserved. -// -// -// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque convallis non leo nec -// mollis. Vestibulum ac tortor tincidunt, vestibulum nunc in, egestas arcu. -// - -using System.Runtime.Serialization; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Formatting.Data -{ - public class StyleCopHeaderFormat - { - - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Formatting/Data/XMLCommentFormat.cs b/CodeMaid.IntegrationTests/Formatting/Data/XMLCommentFormat.cs deleted file mode 100644 index fe3e8644d..000000000 --- a/CodeMaid.IntegrationTests/Formatting/Data/XMLCommentFormat.cs +++ /dev/null @@ -1,62 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Formatting.Data -{ - public class XMLCommentFormat - { - /// - /// Firsts the method. This method has a really long description that will cover over multiple lines without any regard for the duration expected - /// of a traditional comment that has more respect for being at a reasonable length instead of an exceedingly long length. - /// The first parameter. The second parameter. - /// True if the method has a true result, otherwise false. - public bool FirstMethod(string param1, string param2) - { - return false; - } - - /// - /// The method summary with a long description that just goes on for a long period of time that will exceed the line boundary. - /// - /// A remarks section that has a very long description that just goes on for a long period of time that will exceed the line boundary. - /// - /// An example that has a very long description that just goes on for a long period of time that will exceed the line boundary. - /// A parameter that has a very long description that just goes on for a long period of time that will exceed the line boundary. - /// A return statement that has a very long description that just goes on for a long period of time that will exceed the line boundary. - /// An exception that has a very long description that just goes on for a long period of time that will exceed the line boundary. - public bool SecondMethod(bool isParam) - { - return false; - } - - /// - public void ThirdMethod() - { - } - - /// - /// The summary for the comment. - /// - /// Max number of elements returned in - /// The array. - public void FourthMethod(int maxSize, int[] array) - { - } - - /// - /// This comment contains XMLCommentFormat an example of the c tag. - /// - public void FifthMethod() - { - } - - /// - /// This comment would only have a single word to wrap, which is wasteful and should be ignored. - /// - public void SixthMethod() - { - } - - /// - public void SeventhMethod() - { - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Formatting/Data/XMLCommentFormat_Formatted.cs b/CodeMaid.IntegrationTests/Formatting/Data/XMLCommentFormat_Formatted.cs deleted file mode 100644 index 9ba2e8148..000000000 --- a/CodeMaid.IntegrationTests/Formatting/Data/XMLCommentFormat_Formatted.cs +++ /dev/null @@ -1,83 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Formatting.Data -{ - public class XMLCommentFormat - { - /// - /// Firsts the method. This method has a really long description that will cover over - /// multiple lines without any regard for the duration expected of a traditional comment that - /// has more respect for being at a reasonable length instead of an exceedingly long length. - /// - /// The first parameter. - /// The second parameter. - /// True if the method has a true result, otherwise false. - public bool FirstMethod(string param1, string param2) - { - return false; - } - - /// - /// The method summary with a long description that just goes on for a long period of time - /// that will exceed the line boundary. - /// - /// - /// A remarks section that has a very long description that just goes on for a long period of - /// time that will exceed the line boundary. - /// - /// - /// An example that has a very long description that just goes on for a long period of time - /// that will exceed the line boundary. - /// - /// - /// A parameter that has a very long description that just goes on for a long period of time - /// that will exceed the line boundary. - /// - /// - /// A return statement that has a very long description that just goes on for a long period - /// of time that will exceed the line boundary. - /// - /// - /// An exception that has a very long description that just goes on for a long period of time - /// that will exceed the line boundary. - /// - public bool SecondMethod(bool isParam) - { - return false; - } - - /// - /// - /// - public void ThirdMethod() - { - } - - /// - /// The summary for the comment. - /// - /// Max number of elements returned in - /// The array. - public void FourthMethod(int maxSize, int[] array) - { - } - - /// - /// This comment contains XMLCommentFormat an example of the c tag. - /// - public void FifthMethod() - { - } - - /// - /// This comment would only have a single word to wrap, which is wasteful and should be ignored. - /// - public void SixthMethod() - { - } - - /// - /// - public void SeventhMethod() - { - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Formatting/StandardCommentFormatTests.cs b/CodeMaid.IntegrationTests/Formatting/StandardCommentFormatTests.cs deleted file mode 100644 index 8f048f54d..000000000 --- a/CodeMaid.IntegrationTests/Formatting/StandardCommentFormatTests.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Formatting -{ - [TestClass] - [DeploymentItem(@"Formatting\Data\StandardCommentFormat.cs", "Data")] - [DeploymentItem(@"Formatting\Data\StandardCommentFormat_Formatted.cs", "Data")] - public class StandardCommentFormatTests : BaseCommentFormatTests - { - #region Setup - - protected override string TestBaseFileName => "StandardCommentFormat"; - - [ClassInitialize] - public new static void ClassInitialize(TestContext testContext) - { - BaseCommentFormatTests.ClassInitialize(testContext); - } - - [TestInitialize] - public override void TestInitialize() - { - base.TestInitialize(); - } - - [TestCleanup] - public override void TestCleanup() - { - base.TestCleanup(); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - [TestCategory("Formatting")] - public void FormatStandardComments_FormatsAsExpected() - { - FormatsAsExpected(); - } - - [TestMethod] - [HostType("VS IDE")] - [TestCategory("Formatting")] - public void FormatStandardComments_DoesNothingOnSecondPass() - { - DoesNothingOnSecondPass(); - } - - [TestMethod] - [HostType("VS IDE")] - [TestCategory("Formatting")] - public void FormatStandardComments_DoesNothingWhenSettingIsDisabled() - { - DoesNothingWhenSettingIsDisabled(); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Formatting/StylecopHeaderFormatTests.cs b/CodeMaid.IntegrationTests/Formatting/StylecopHeaderFormatTests.cs deleted file mode 100644 index 7d889e782..000000000 --- a/CodeMaid.IntegrationTests/Formatting/StylecopHeaderFormatTests.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Formatting -{ - [TestClass] - [DeploymentItem(@"Formatting\Data\StyleCopHeaderFormat.cs", "Data")] - [DeploymentItem(@"Formatting\Data\StyleCopHeaderFormat_Formatted.cs", "Data")] - public class StyleCopHeaderFormatTests : BaseCommentFormatTests - { - #region Setup - - protected override string TestBaseFileName => "StyleCopHeaderFormat"; - - [ClassInitialize] - public new static void ClassInitialize(TestContext testContext) - { - BaseCommentFormatTests.ClassInitialize(testContext); - } - - [TestInitialize] - public override void TestInitialize() - { - base.TestInitialize(); - } - - [TestCleanup] - public override void TestCleanup() - { - base.TestCleanup(); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - [TestCategory("Formatting")] - public void FormatStyleCopHeaderComments_FormatsAsExpected() - { - FormatsAsExpected(); - } - - [TestMethod] - [HostType("VS IDE")] - [TestCategory("Formatting")] - public void FormatStyleCopHeaderComments_DoesNothingOnSecondPass() - { - DoesNothingOnSecondPass(); - } - - [TestMethod] - [HostType("VS IDE")] - [TestCategory("Formatting")] - public void FormatStyleCopHeaderComments_DoesNothingWhenSettingIsDisabled() - { - DoesNothingWhenSettingIsDisabled(); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Formatting/XMLCommentFormatTests.cs b/CodeMaid.IntegrationTests/Formatting/XMLCommentFormatTests.cs deleted file mode 100644 index 836d5f56b..000000000 --- a/CodeMaid.IntegrationTests/Formatting/XMLCommentFormatTests.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Formatting -{ - [TestClass] - [DeploymentItem(@"Formatting\Data\XMLCommentFormat.cs", "Data")] - [DeploymentItem(@"Formatting\Data\XMLCommentFormat_Formatted.cs", "Data")] - public class XMLCommentFormatTests : BaseCommentFormatTests - { - #region Setup - - protected override string TestBaseFileName => "XMLCommentFormat"; - - [ClassInitialize] - public new static void ClassInitialize(TestContext testContext) - { - BaseCommentFormatTests.ClassInitialize(testContext); - } - - [TestInitialize] - public override void TestInitialize() - { - base.TestInitialize(); - } - - [TestCleanup] - public override void TestCleanup() - { - base.TestCleanup(); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - [TestCategory("Formatting")] - public void FormatXMLComments_FormatsAsExpected() - { - FormatsAsExpected(); - } - - [TestMethod] - [HostType("VS IDE")] - [TestCategory("Formatting")] - public void FormatXMLComments_DoesNothingOnSecondPass() - { - DoesNothingOnSecondPass(); - } - - [TestMethod] - [HostType("VS IDE")] - [TestCategory("Formatting")] - public void FormatXMLComments_DoesNothingWhenSettingIsDisabled() - { - DoesNothingWhenSettingIsDisabled(); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Helpers/DialogBoxPurger.cs b/CodeMaid.IntegrationTests/Helpers/DialogBoxPurger.cs deleted file mode 100644 index 8d298cba2..000000000 --- a/CodeMaid.IntegrationTests/Helpers/DialogBoxPurger.cs +++ /dev/null @@ -1,374 +0,0 @@ -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using System; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Helpers -{ - /// - /// This class is responsible to close dialog boxes that pop up during different VS Calls - /// - /// - /// Part of VSIX unit testing starter kit. - /// - internal class DialogBoxPurger : IDisposable - { - /// - /// The default number of milliseconds to wait for the threads to signal to terminate. - /// - private const int DefaultMillisecondsToWait = 3500; - - /// - /// Object used for synchronization between thread calls. - /// - internal static volatile object Mutex = new object(); - - /// - /// The IVsUIShell. This cannot be queried on the working thread from the service provider. - /// Must be done in the main thread.!! - /// - private IVsUIShell _uiShell; - - /// - /// The button to "press" on the dialog. - /// - private readonly int _buttonAction; - - /// - /// Thread signales to the calling thread that it is done. - /// - private bool _exitThread; - - /// - /// Calling thread signales to this thread to die. - /// - private readonly AutoResetEvent _threadDone = new AutoResetEvent(false); - - /// - /// The queued thread started. - /// - private readonly AutoResetEvent _threadStarted = new AutoResetEvent(false); - - /// - /// The result of the dialogbox closing for all the dialog boxes. That is if there are two - /// of them and one fails this will be false. - /// - private bool _dialogBoxCloseResult; - - /// - /// The expected text to see on the dialog box. If set the thread will continue finding the - /// dialog box with this text. - /// - private readonly string _expectedDialogBoxText = String.Empty; - - /// - /// The number of the same dialog boxes to wait for. This is for scenarios when two dialog - /// boxes with the same text are popping up. - /// - private readonly int _numberOfDialogsToWaitFor = 1; - - /// - /// Has the object been disposed. - /// - private bool _isDisposed; - - /// - /// Overloaded ctor. - /// - /// The botton to "press" on the dialog box. - /// - /// The number of dialog boxes with the same message to wait for. This is the situation when - /// the same action pops up two of the same dialog boxes - /// - /// The expected dialog box message to check for. - internal DialogBoxPurger(int buttonAction, int numberOfDialogsToWaitFor, string expectedDialogMesssage) - { - _buttonAction = buttonAction; - _numberOfDialogsToWaitFor = numberOfDialogsToWaitFor; - _expectedDialogBoxText = expectedDialogMesssage; - } - - /// - /// Overloaded ctor. - /// - /// The botton to "press" on the dialog box. - /// - /// The number of dialog boxes with the same message to wait for. This is the situation when - /// the same action pops up two of the same dialog boxes - /// - internal DialogBoxPurger(int buttonAction, int numberOfDialogsToWaitFor) - { - _buttonAction = buttonAction; - _numberOfDialogsToWaitFor = numberOfDialogsToWaitFor; - } - - /// - /// Overloaded ctor. - /// - /// The botton to "press" on the dialog box. - /// The expected dialog box message to check for. - internal DialogBoxPurger(int buttonAction, string expectedDialogMesssage) - { - _buttonAction = buttonAction; - _expectedDialogBoxText = expectedDialogMesssage; - } - - /// - /// Overloaded ctor. - /// - /// The botton to "press" on the dialog box. - internal DialogBoxPurger(int buttonAction) - { - _buttonAction = buttonAction; - } - - #region IDisposable Members - - void IDisposable.Dispose() - { - if (_isDisposed) - { - return; - } - - WaitForDialogThreadToTerminate(); - - _isDisposed = true; - } - - /// - /// Spawns a thread that will start listening to dialog boxes. - /// - internal void Start() - { - // We ask for the uishell here since we cannot do that on the therad that we will spawn. - IVsUIShell uiShell = Package.GetGlobalService(typeof(SVsUIShell)) as IVsUIShell; - - if (uiShell == null) - { - throw new InvalidOperationException("Could not get the uiShell from the serviceProvider"); - } - - _uiShell = uiShell; - - var thread = new Thread(HandleDialogBoxes); - thread.Start(); - - // We should never deadlock here, hence do not use the lock. Wait to be sure that the - // thread started. - _threadStarted.WaitOne(3500, false); - } - - /// - /// Waits for the dialog box close thread to terminate. If the thread does not signal back - /// within millisecondsToWait that it is shutting down, then it will tell to the thread to - /// do it. - /// - internal bool WaitForDialogThreadToTerminate() - { - return WaitForDialogThreadToTerminate(DefaultMillisecondsToWait); - } - - /// - /// Waits for the dialog box close thread to terminate. If the thread does not signal back - /// within millisecondsToWait that it is shutting down, then it will tell to the thread to - /// do it. - /// - /// - /// The number milliseconds to wait for until the dialog purger thread is signaled to - /// terminate. This is just for safe precaution that we do not hang. - /// - /// The result of the dialog boxes closing - internal bool WaitForDialogThreadToTerminate(int numberOfMillisecondsToWait) - { - // We give millisecondsToWait sec to bring up and close the dialog box. - bool signaled = _threadDone.WaitOne(numberOfMillisecondsToWait, false); - - // Kill the thread since a timeout occured. - if (!signaled) - { - lock (Mutex) - { - // Set the exit thread to true. Next time the thread will kill itselfes if it sees - _exitThread = true; - } - - // Wait for the thread to finish. We should never deadlock here. - _threadDone.WaitOne(); - } - - return _dialogBoxCloseResult; - } - - /// - /// This is the thread method. - /// - private void HandleDialogBoxes() - { - // No synchronization numberOfDialogsToWaitFor since it is readonly - IntPtr[] hwnds = new IntPtr[_numberOfDialogsToWaitFor]; - bool[] dialogBoxCloseResults = new bool[_numberOfDialogsToWaitFor]; - - try - { - // Signal that we started - lock (Mutex) - { - _threadStarted.Set(); - } - - // The loop will be exited either if a message is send by the caller thread or if we - // found the dialog. If a message box text is specified the loop will not exit until - // the dialog is found. - bool stayInLoop = true; - int dialogBoxesToWaitFor = 1; - - while (stayInLoop) - { - int hwndIndex = dialogBoxesToWaitFor - 1; - - // We need to lock since the caller might set context to null. - lock (Mutex) - { - if (_exitThread) - { - break; - } - - // We protect the shell too from reentrency. - _uiShell.GetDialogOwnerHwnd(out hwnds[hwndIndex]); - } - - if (hwnds[hwndIndex] != IntPtr.Zero) - { - StringBuilder windowClassName = new StringBuilder(256); - NativeMethods.GetClassName(hwnds[hwndIndex], windowClassName, windowClassName.Capacity); - - //NOTE: Removed the window class name guard for #32770 in order to pick up DialogWindowBase used for VS2010+. - IntPtr unmanagedMemoryLocation = IntPtr.Zero; - string dialogBoxText; - try - { - unmanagedMemoryLocation = Marshal.AllocHGlobal(10 * 1024); - NativeMethods.EnumChildWindows(hwnds[hwndIndex], FindMessageBoxString, unmanagedMemoryLocation); - dialogBoxText = Marshal.PtrToStringUni(unmanagedMemoryLocation); - } - finally - { - if (unmanagedMemoryLocation != IntPtr.Zero) - { - Marshal.FreeHGlobal(unmanagedMemoryLocation); - } - } - - lock (Mutex) - { - // Since this is running on the main thread be sure that we close the dialog. - bool dialogCloseResult = false; - if (_buttonAction != 0) - { - dialogCloseResult = NativeMethods.EndDialog(hwnds[hwndIndex], _buttonAction); - } - - // Check if we have found the right dialog box. - if (String.IsNullOrEmpty(_expectedDialogBoxText) || - (!String.IsNullOrEmpty(dialogBoxText) && - String.Compare(_expectedDialogBoxText, dialogBoxText.Trim(), - StringComparison.OrdinalIgnoreCase) == 0)) - { - dialogBoxCloseResults[hwndIndex] = dialogCloseResult; - if (dialogBoxesToWaitFor++ >= _numberOfDialogsToWaitFor) - { - stayInLoop = false; - } - } - } - } - } - } - finally - { - //Let the main thread run a possible close command. - Thread.Sleep(2000); - - foreach (IntPtr hwnd in hwnds) - { - // At this point the dialog should be closed, if not attempt to close it. - if (hwnd != IntPtr.Zero) - { - NativeMethods.SendMessage(hwnd, NativeMethods.WM_CLOSE, 0, new IntPtr(0)); - } - } - - lock (Mutex) - { - // Be optimistic. - _dialogBoxCloseResult = true; - - for (int i = 0; i < dialogBoxCloseResults.Length; i++) - { - if (!dialogBoxCloseResults[i]) - { - _dialogBoxCloseResult = false; - break; - } - } - - _threadDone.Set(); - } - } - } - - /// - /// Finds a messagebox string on a messagebox. - /// - /// The windows handle of the dialog - /// - /// A pointer to the memorylocation the string will be written to - /// - /// True if found. - private static bool FindMessageBoxString(IntPtr hwnd, IntPtr unmanagedMemoryLocation) - { - StringBuilder sb = new StringBuilder(512); - NativeMethods.GetClassName(hwnd, sb, sb.Capacity); - - if (sb.ToString().ToLower().Contains("static")) - { - StringBuilder windowText = new StringBuilder(2048); - NativeMethods.GetWindowText(hwnd, windowText, windowText.Capacity); - - if (windowText.Length > 0) - { - IntPtr stringAsPtr = IntPtr.Zero; - try - { - stringAsPtr = Marshal.StringToHGlobalAnsi(windowText.ToString()); - char[] stringAsArray = windowText.ToString().ToCharArray(); - - // Since unicode characters are copied check if we are out of the allocated - // length. If not add the end terminating zero. - if ((2 * stringAsArray.Length) + 1 < 2048) - { - Marshal.Copy(stringAsArray, 0, unmanagedMemoryLocation, stringAsArray.Length); - Marshal.WriteInt32(unmanagedMemoryLocation, 2 * stringAsArray.Length, 0); - } - } - finally - { - if (stringAsPtr != IntPtr.Zero) - { - Marshal.FreeHGlobal(stringAsPtr); - } - } - return false; - } - } - - return true; - } - - #endregion IDisposable Members - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Helpers/NativeMethods.cs b/CodeMaid.IntegrationTests/Helpers/NativeMethods.cs deleted file mode 100644 index 0bccc2529..000000000 --- a/CodeMaid.IntegrationTests/Helpers/NativeMethods.cs +++ /dev/null @@ -1,151 +0,0 @@ -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -using System; -using System.Runtime.InteropServices; -using System.Text; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Helpers -{ - /// - /// Defines pinvoked utility methods and internal VS Constants - /// - /// - /// Part of VSIX unit testing starter kit. - /// - internal static class NativeMethods - { - internal delegate bool CallBack(IntPtr hwnd, IntPtr lParam); - - // Declare two overloaded SendMessage functions - [DllImport("user32.dll")] - internal static extern UInt32 SendMessage(IntPtr hWnd, UInt32 Msg, - UInt32 wParam, IntPtr lParam); - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - internal static extern bool PeekMessage([In, Out] ref Microsoft.VisualStudio.OLE.Interop.MSG msg, HandleRef hwnd, int msgMin, int msgMax, int remove); - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - internal static extern bool TranslateMessage([In, Out] ref Microsoft.VisualStudio.OLE.Interop.MSG msg); - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - internal static extern int DispatchMessage([In] ref Microsoft.VisualStudio.OLE.Interop.MSG msg); - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - internal static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool attach); - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - internal static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); - - [DllImport("kernel32.dll", CharSet = CharSet.Auto)] - internal static extern uint GetCurrentThreadId(); - - [DllImport("user32")] - internal static extern int EnumChildWindows(IntPtr hwnd, CallBack x, IntPtr y); - - [DllImport("user32")] - internal static extern bool IsWindowVisible(IntPtr hDlg); - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - internal static extern IntPtr SetFocus(IntPtr hWnd); - - [DllImport("user32")] - internal static extern int GetClassName(IntPtr hWnd, - StringBuilder className, - int stringLength); - - [DllImport("user32")] - internal static extern int GetWindowText(IntPtr hWnd, StringBuilder className, int stringLength); - - [DllImport("user32")] - internal static extern bool EndDialog(IntPtr hDlg, int result); - - [DllImport("Kernel32")] - internal static extern long GetLastError(); - - internal const int QS_KEY = 0x0001, - QS_MOUSEMOVE = 0x0002, - QS_MOUSEBUTTON = 0x0004, - QS_POSTMESSAGE = 0x0008, - QS_TIMER = 0x0010, - QS_PAINT = 0x0020, - QS_SENDMESSAGE = 0x0040, - QS_HOTKEY = 0x0080, - QS_ALLPOSTMESSAGE = 0x0100, - QS_MOUSE = QS_MOUSEMOVE | QS_MOUSEBUTTON, - QS_INPUT = QS_MOUSE | QS_KEY, - QS_ALLEVENTS = QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY, - QS_ALLINPUT = QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY | QS_SENDMESSAGE; - - internal const int Facility_Win32 = 7; - - internal const int WM_CLOSE = 0x0010; - - internal const int - S_FALSE = 0x00000001, - S_OK = 0x00000000, - - IDOK = 1, - IDCANCEL = 2, - IDABORT = 3, - IDRETRY = 4, - IDIGNORE = 5, - IDYES = 6, - IDNO = 7, - IDCLOSE = 8, - IDHELP = 9, - IDTRYAGAIN = 10, - IDCONTINUE = 11; - - internal static long HResultFromWin32(long error) - { - if (error <= 0) - { - return error; - } - - return ((error & 0x0000FFFF) | (Facility_Win32 << 16) | 0x80000000); - } - - /// Please use this "approved" method to compare file names. - public static bool IsSamePath(string file1, string file2) - { - if (file1 == null || file1.Length == 0) - { - return (file2 == null || file2.Length == 0); - } - - Uri uri1; - Uri uri2; - - try - { - if (!Uri.TryCreate(file1, UriKind.Absolute, out uri1) || !Uri.TryCreate(file2, UriKind.Absolute, out uri2)) - { - return false; - } - - if (uri1 != null && uri1.IsFile && uri2 != null && uri2.IsFile) - { - return 0 == String.Compare(uri1.LocalPath, uri2.LocalPath, StringComparison.OrdinalIgnoreCase); - } - - return file1 == file2; - } - catch (UriFormatException e) - { - System.Diagnostics.Trace.WriteLine("Exception " + e.Message); - } - - return false; - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Helpers/TestEnvironment.cs b/CodeMaid.IntegrationTests/Helpers/TestEnvironment.cs deleted file mode 100644 index 08c320292..000000000 --- a/CodeMaid.IntegrationTests/Helpers/TestEnvironment.cs +++ /dev/null @@ -1,142 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.Properties; -using System; -using System.ComponentModel.Design; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Helpers -{ - /// - /// The TestEnvironment performs an AssemblyInitialize unit test method to setup the test - /// environment and capture state for easy access by unit tests. - /// - [TestClass] - public static class TestEnvironment - { - /// - /// Gets the . - /// - public static CodeMaidPackage Package { get; private set; } - - /// - /// Gets the test project. - /// - public static Project Project { get; private set; } - - /// - /// This method perform a one-time initialization across all unit tests in the assembly. - /// - /// The test context. - [AssemblyInitialize] - public static void AssemblyInitialize(TestContext testContext) - { - UIThreadInvoker.Invoke(new Action(() => - { - // Load the package into the shell. - IVsShell shellService = (IVsShell)VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)); - Guid packageGuid = new Guid(PackageGuids.GuidCodeMaidPackageString); - IVsPackage package; - - shellService.IsPackageLoaded(ref packageGuid, out package); - - if (package == null) - { - shellService.LoadPackage(ref packageGuid, out package); - } - - Assert.IsTrue(package is CodeMaidPackage); - Package = (CodeMaidPackage)package; - - // Generate an empty solution. - const string projectName = "IntegrationTests"; - TestUtils.CreateEmptySolution(testContext.TestDir, projectName); - Assert.AreEqual(0, TestUtils.ProjectCount()); - - // Generate an empty project. - TestUtils.CreateProjectFromTemplate(projectName, "ConsoleApplication.zip", "CSharp"); - Assert.AreEqual(1, TestUtils.ProjectCount()); - - // Capture the project for later use. - Project = Package.IDE.Solution.Projects.Item(1); - Assert.IsNotNull(Project); - Assert.AreEqual(Project.Name, projectName); - })); - } - - /// - /// A set of common actions for test initialization to be shared across most unit tests. - /// - public static void CommonTestInitialize() - { - // Reset all settings to default. - Settings.Default.Reset(); - } - - /// - /// Gets the package command based on the specified command ID. - /// - /// The command ID to retrieve. - /// The package command. - public static MenuCommand GetPackageCommand(CommandID commandID) - { - MenuCommand command = null; - - Package.JoinableTaskFactory.Run(async () => - { - if (await Package.GetServiceAsync(typeof(IMenuCommandService)) is OleMenuCommandService menuCommandService) - { - command = menuCommandService.FindCommand(commandID); - } - }); - - Assert.IsNotNull(command); - - return command; - } - - /// - /// Loads the specified file into the test project. - /// - /// The path to the file to load. - /// The project item representing the loaded file. - public static ProjectItem LoadFileIntoProject(string path) - { - ProjectItem projectItem = null; - - UIThreadInvoker.Invoke(new Action(() => - { - int initialCount = Project.ProjectItems.Count; - - projectItem = Project.ProjectItems.AddFromFileCopy(path); - - Assert.IsNotNull(projectItem); - Assert.AreEqual(initialCount + 1, Project.ProjectItems.Count); - })); - - Assert.IsNotNull(projectItem); - - return projectItem; - } - - /// - /// Removes the specified project item from the test project. - /// - /// The project item to remove. - public static void RemoveFromProject(ProjectItem projectItem) - { - Assert.IsNotNull(projectItem); - - UIThreadInvoker.Invoke(new Action(() => - { - int initialCount = Project.ProjectItems.Count; - - projectItem.Delete(); - - Assert.AreEqual(initialCount - 1, Project.ProjectItems.Count); - })); - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Helpers/TestOperations.cs b/CodeMaid.IntegrationTests/Helpers/TestOperations.cs deleted file mode 100644 index 9d4ad5cc9..000000000 --- a/CodeMaid.IntegrationTests/Helpers/TestOperations.cs +++ /dev/null @@ -1,115 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.Model; -using System; -using System.IO; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Helpers -{ - /// - /// A helper class for performing standard test operations. - /// - public static class TestOperations - { - /// - /// Gets the . - /// - internal static CodeModelManager CodeModelManager => CodeModelManager.GetInstance(TestEnvironment.Package); - - /// - /// Executes the specified command on the specified project item and verifies the results - /// against the specified baseline file. - /// - /// The command to execute. - /// The project item to execute the command upon. - /// The path to the baseline file for results comparison. - public static void ExecuteCommandAndVerifyResults(Action command, ProjectItem projectItem, string baselinePath) - { - UIThreadInvoker.Invoke(new Action(() => - { - var document = GetActivatedDocument(projectItem); - - // Run command and assert it is not saved afterwards. - Assert.IsTrue(document.Saved, "ExecuteCommandAndVerifyResults was not initially saved"); - command(document); - Assert.IsFalse(document.Saved, "ExecuteCommandAndVerifyResults did not change save state as expected"); - - // Save the document. - document.Save(); - Assert.IsTrue(document.Saved, "ExecuteCommandAndVerifyResults was not finally saved"); - - // Read the file contents of the baseline and cleaned content and assert they match. - var baselineContent = File.ReadAllText(baselinePath); - var cleanedContent = File.ReadAllText(document.FullName); - - Assert.AreEqual(baselineContent, cleanedContent); - })); - } - - /// - /// Executes the specified command on the specified project item twice and verifies the - /// second execution does not result in any changes. - /// - /// The command to execute. - /// The project item to execute the command upon. - public static void ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(Action command, ProjectItem projectItem) - { - UIThreadInvoker.Invoke(new Action(() => - { - var document = GetActivatedDocument(projectItem); - - // Run command a first time and assert it is not saved afterwards. - Assert.IsTrue(document.Saved, "ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass was not initially saved"); - command(document); - Assert.IsFalse(document.Saved, "ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass did not change save state as expected"); - - // Save the document. - document.Save(); - Assert.IsTrue(document.Saved, "ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass was not secondarily saved"); - - // Run command a second time and assert it is still in a saved state (i.e. no changes). - command(document); - Assert.IsTrue(document.Saved, "ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass was not finally saved"); - })); - } - - /// - /// Executes the specified command on the specified project item and verifies no change occurs. - /// - /// - /// Generally used for disabled setting tests. - /// - /// The command to execute. - /// The project item to execute the command upon. - public static void ExecuteCommandAndVerifyNoChanges(Action command, ProjectItem projectItem) - { - UIThreadInvoker.Invoke(new Action(() => - { - var document = GetActivatedDocument(projectItem); - - // Run command and assert it is still in a saved state (i.e. no changes). - Assert.IsTrue(document.Saved, "ExecuteCommandAndVerifyNoChanges was not initially saved"); - command(document); - Assert.IsTrue(document.Saved, "ExecuteCommandAndVerifyNoChanges changed save state"); - })); - } - - /// - /// Gets an activated document for the specified project item. - /// - /// The project item. - /// The document associated with the project item, opened and activated. - public static Document GetActivatedDocument(ProjectItem projectItem) - { - projectItem.Open(Constants.vsViewKindTextView); - - var document = projectItem.Document; - Assert.IsNotNull(projectItem.Document); - - document.Activate(); - - return document; - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Helpers/TestUtils.cs b/CodeMaid.IntegrationTests/Helpers/TestUtils.cs deleted file mode 100644 index 089b7097e..000000000 --- a/CodeMaid.IntegrationTests/Helpers/TestUtils.cs +++ /dev/null @@ -1,416 +0,0 @@ -using EnvDTE; -using EnvDTE80; -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.Helpers; -using System; -using System.ComponentModel.Design; -using System.Diagnostics; -using System.IO; -using System.Reflection; -using System.Text; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Helpers -{ - /// - /// Part of VSIX unit testing starter kit. - /// - public static class TestUtils - { - #region Methods: Handling embedded resources - - /// - /// Gets the embedded file identified by the resource name, and converts the file into a string. - /// - /// - /// In VS, is DefaultNamespace.FileName? - /// - public static string GetEmbeddedStringResource(Assembly assembly, string resourceName) - { - string result = null; - - // Use the .NET procedure for loading a file embedded in the assembly - Stream stream = assembly.GetManifestResourceStream(resourceName); - if (stream != null) - { - // Convert bytes to string - byte[] fileContentsAsBytes = new byte[stream.Length]; - stream.Read(fileContentsAsBytes, 0, (int)stream.Length); - result = Encoding.Default.GetString(fileContentsAsBytes); - } - else - { - // Embedded resource not found - list available resources - Debug.WriteLine("Unable to find the embedded resource file '" + resourceName + "'."); - Debug.WriteLine(" Available resources:"); - foreach (string aResourceName in assembly.GetManifestResourceNames()) - { - Debug.WriteLine(" " + aResourceName); - } - } - - return result; - } - - public static void WriteEmbeddedResourceToFile(Assembly assembly, string embeddedResourceName, string fileName) - { - // Get file contents - string fileContents = GetEmbeddedStringResource(assembly, embeddedResourceName); - if (fileContents == null) - throw new ApplicationException("Failed to get embedded resource '" + embeddedResourceName + "' from assembly '" + assembly.FullName); - - // Write to file - StreamWriter sw = new StreamWriter(fileName); - sw.Write(fileContents); - sw.Close(); - } - - /// - /// Writes an embedded resource to a file. - /// - /// - /// The name of the assembly that the embedded resource is defined. - /// - /// The name of the embedded resource. - /// The file to write the embedded resource's content. - public static void WriteEmbeddedResourceToBinaryFile(Assembly assembly, string embeddedResourceName, string fileName) - { - // Get file contents - Stream stream = assembly.GetManifestResourceStream(embeddedResourceName); - if (stream == null) - throw new InvalidOperationException("Failed to get embedded resource '" + embeddedResourceName + "' from assembly '" + assembly.FullName); - - // Write to file - BinaryWriter sw = null; - FileStream fs = null; - try - { - byte[] fileContentsAsBytes = new byte[stream.Length]; - stream.Read(fileContentsAsBytes, 0, (int)stream.Length); - - FileMode mode = FileMode.CreateNew; - if (File.Exists(fileName)) - { - mode = FileMode.Truncate; - } - - fs = new FileStream(fileName, mode); - - sw = new BinaryWriter(fs); - sw.Write(fileContentsAsBytes); - } - finally - { - if (fs != null) - { - fs.Close(); - } - if (sw != null) - { - sw.Close(); - } - } - } - - #endregion Methods: Handling embedded resources - - #region Methods: Handling temporary files and directories - - /// - /// Returns the first available file name on the form [baseFileName]i.[extension] where [i] - /// starts at 1 and increases until there is an available file name in the given directory. - /// Also creates an empty file with that name to mark that file as occupied. - /// - /// Directory that the file should live in. - /// - /// - /// may be null, in which case the .[extension] part is not added. - /// - /// Full file name. - public static string GetNewFileName(string directory, string baseFileName, string extension) - { - // Get the new file name - string fileName = GetNewFileOrDirectoryNameWithoutCreatingAnything(directory, baseFileName, extension); - - // Create an empty file to mark it as taken - StreamWriter sw = new StreamWriter(fileName); - - sw.Write(""); - sw.Close(); - return fileName; - } - - /// - /// Returns the first available directory name on the form [baseDirectoryName]i where [i] - /// starts at 1 and increases until there is an available directory name in the given - /// directory. Also creates the directory to mark it as occupied. - /// - /// Directory that the file should live in. - /// - /// Full directory name. - public static string GetNewDirectoryName(string directory, string baseDirectoryName) - { - // Get the new file name - string directoryName = GetNewFileOrDirectoryNameWithoutCreatingAnything(directory, baseDirectoryName, null); - - // Create an empty directory to make it as occupied - Directory.CreateDirectory(directoryName); - - return directoryName; - } - - private static string GetNewFileOrDirectoryNameWithoutCreatingAnything(string directory, string baseFileName, string extension) - { - // - get a file name that we can use - string fileName; - int i = 1; - - string fullFileName; - while (true) - { - // construct next file name - fileName = baseFileName + i; - if (extension != null) - fileName += '.' + extension; - - // check if that file exists in the directory - fullFileName = Path.Combine(directory, fileName); - - if (!File.Exists(fullFileName) && !Directory.Exists(fullFileName)) - break; - - i++; - } - - return fullFileName; - } - - #endregion Methods: Handling temporary files and directories - - #region Methods: Handling solutions - - /// - /// Closes the currently open solution (if any), and creates a new solution with the given name. - /// - /// - /// Name of new solution. - public static void CreateEmptySolution(string directory, string solutionName) - { - CloseCurrentSolution(__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave); - - string solutionDirectory = GetNewDirectoryName(directory, solutionName); - - // Create and force save solution - IVsSolution solutionService = (IVsSolution)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)); - solutionService.CreateSolution(solutionDirectory, solutionName, (uint)__VSCREATESOLUTIONFLAGS.CSF_SILENT); - solutionService.SaveSolutionElement((uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_ForceSave, null, 0); - DTE dte = VsIdeTestHostContext.Dte; - Assert.AreEqual(solutionName + ".sln", Path.GetFileName(dte.Solution.FileName), "Newly created solution has wrong Filename"); - } - - public static void CloseCurrentSolution(__VSSLNSAVEOPTIONS saveoptions) - { - // Get solution service - IVsSolution solutionService = (IVsSolution)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)); - - // Close already open solution - solutionService.CloseSolutionElement((uint)saveoptions, null, 0); - } - - public static void ForceSaveSolution() - { - // Get solution service - IVsSolution solutionService = (IVsSolution)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)); - - // Force-save the solution - solutionService.SaveSolutionElement((uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_ForceSave, null, 0); - } - - /// - /// Get current number of open project in solution - /// - /// - public static int ProjectCount() - { - // Get solution service - IVsSolution solutionService = (IVsSolution)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)); - object projectCount; - solutionService.GetProperty((int)__VSPROPID.VSPROPID_ProjectCount, out projectCount); - return (int)projectCount; - } - - #endregion Methods: Handling solutions - - #region Methods: Handling projects - - /// - /// Creates a project. - /// - /// Name of new project. - /// Name of project template to use - /// language - /// New project. - public static void CreateProjectFromTemplate(string projectName, string templateName, string language) - { - DTE dte = (DTE)VsIdeTestHostContext.ServiceProvider.GetService(typeof(DTE)); - - Solution2 sol = dte.Solution as Solution2; - string projectTemplate = sol.GetProjectTemplate(templateName, language); - - // - project name and directory - string solutionDirectory = Directory.GetParent(dte.Solution.FullName).FullName; - string projectDirectory = GetNewDirectoryName(solutionDirectory, projectName); - - dte.Solution.AddFromTemplate(projectTemplate, projectDirectory, projectName); - } - - #endregion Methods: Handling projects - - #region Methods: Handling project items - - /// - /// Create a new item in the project - /// - /// the parent collection for the new item - /// - /// - /// - /// - public static ProjectItem AddNewItemFromVsTemplate(ProjectItems parent, string templateName, string language, string name) - { - if (parent == null) - throw new ArgumentException("project"); - if (name == null) - throw new ArgumentException("name"); - - DTE dte = (DTE)VsIdeTestHostContext.ServiceProvider.GetService(typeof(DTE)); - - Solution2 sol = dte.Solution as Solution2; - - string filename = sol.GetProjectItemTemplate(templateName, language); - - parent.AddFromTemplate(filename, name); - - return parent.Item(name); - } - - /// - /// Save an open document. - /// - /// - /// for filebased documents this is the full path to the document - /// - public static void SaveDocument(string documentMoniker) - { - // Get document cookie and hierarchy for the file - IVsRunningDocumentTable runningDocumentTableService = (IVsRunningDocumentTable)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsRunningDocumentTable)); - uint docCookie; - IntPtr docData; - IVsHierarchy hierarchy; - uint itemId; - runningDocumentTableService.FindAndLockDocument( - (uint)_VSRDTFLAGS.RDT_NoLock, - documentMoniker, - out hierarchy, - out itemId, - out docData, - out docCookie); - - // Save the document - IVsSolution solutionService = (IVsSolution)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)); - solutionService.SaveSolutionElement((uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_ForceSave, hierarchy, docCookie); - } - - public static void CloseInEditorWithoutSaving(string fullFileName) - { - // Get the RDT service - IVsRunningDocumentTable runningDocumentTableService = (IVsRunningDocumentTable)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsRunningDocumentTable)); - Assert.IsNotNull(runningDocumentTableService, "Failed to get the Running Document Table Service"); - - // Get our document cookie and hierarchy for the file - uint docCookie; - IntPtr docData; - IVsHierarchy hierarchy; - uint itemId; - runningDocumentTableService.FindAndLockDocument( - (uint)_VSRDTFLAGS.RDT_NoLock, - fullFileName, - out hierarchy, - out itemId, - out docData, - out docCookie); - - // Get the SolutionService - IVsSolution solutionService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)) as IVsSolution; - Assert.IsNotNull(solutionService, "Failed to get IVsSolution service"); - - // Close the document - solutionService.CloseSolutionElement( - (uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave, - hierarchy, - docCookie); - } - - #endregion Methods: Handling project items - - #region Methods: Handling Toolwindows - - public static bool CanFindToolwindow(Guid persistenceGuid) - { - IVsUIShell uiShellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsUIShell)) as IVsUIShell; - Assert.IsNotNull(uiShellService); - IVsWindowFrame windowFrame; - int hr = uiShellService.FindToolWindow((uint)__VSFINDTOOLWIN.FTW_fFindFirst, ref persistenceGuid, out windowFrame); - Assert.IsTrue(hr == VSConstants.S_OK); - - return (windowFrame != null); - } - - #endregion Methods: Handling Toolwindows - - #region Methods: Loading packages - - public static IVsPackage LoadPackage(Guid packageGuid) - { - IVsShell shellService = (IVsShell)VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)); - IVsPackage package; - shellService.LoadPackage(ref packageGuid, out package); - Assert.IsNotNull(package, "Failed to load package"); - return package; - } - - #endregion Methods: Loading packages - - #region Methods: Miscellaneous - - /// - /// Executes a Command (menu item) in the given context - /// - public static void ExecuteCommand(CommandID cmd) - { - object customin = null; - object customout = null; - string guidString = cmd.Guid.ToString("B").ToUpper(); - int cmdId = cmd.ID; - DTE dte = VsIdeTestHostContext.Dte; - dte.Commands.Raise(guidString, cmdId, ref customin, ref customout); - } - - /// - /// Gets the text document for the specified document. - /// - /// The document to act upon. - /// The text document associated to the document. - public static TextDocument GetTextDocument(Document document) - { - var textDocument = document.GetTextDocument(); - Assert.IsNotNull(textDocument); - - return textDocument; - } - - #endregion Methods: Miscellaneous - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/PackageTests.cs b/CodeMaid.IntegrationTests/PackageTests.cs deleted file mode 100644 index ba9871f1a..000000000 --- a/CodeMaid.IntegrationTests/PackageTests.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests -{ - [TestClass] - public class PackageTests - { - [TestMethod] - [HostType("VS IDE")] - public void PackageLoadTest() - { - UIThreadInvoker.Invoke(new Action(() => - { - // Get the Shell Service - var shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell; - Assert.IsNotNull(shellService); - - // Validate package load - IVsPackage package; - var packageGuid = new Guid(PackageGuids.GuidCodeMaidPackageString); - - Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package)); - Assert.IsNotNull(package, "Package failed to load"); - })); - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Properties/AssemblyInfo.cs b/CodeMaid.IntegrationTests/Properties/AssemblyInfo.cs deleted file mode 100644 index 558004364..000000000 --- a/CodeMaid.IntegrationTests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -using System.Reflection; - -[assembly: AssemblyTitle("SteveCadwallader.CodeMaid.IntegrationTests")] \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertAfterReorder.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertAfterReorder.cs deleted file mode 100644 index 9e2f58fbb..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertAfterReorder.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsInsertAfterReorder - { - public const int ToolbarIDCodeMaidToolbarSpade = 0x1040; - - public const int MenuIDCodeMaidContextSpade = 0x1060; - } - - public static class PackageGuids - { - public const string GuidCodeMaidToolWindowBuildProgressString = "260978c3-582c-487d-ab12-c1fdde07c578"; - public static readonly Guid GuidCodeMaidToolWindowBuildProgress = new Guid(GuidCodeMaidToolWindowBuildProgressString); - public const string GuidCodeMaidToolWindowSpadeString = "75d09b86-471e-4b30-8720-362d13ad0a45"; - public static readonly Guid GuidCodeMaidToolWindowSpade = new Guid(GuidCodeMaidToolWindowSpadeString); - public static readonly Guid GuidCodeMaidMenuSolutionExplorerGroup = new Guid("d69f1580-274f-4d12-b13a-c365c759de66"); - public static readonly Guid GuidCodeMaidMenuVisualizeGroup = new Guid("a4ef7624-6477-4860-85bc-46564429f935"); - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertAfterReorder_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertAfterReorder_Reorganized.cs deleted file mode 100644 index 27add9e63..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertAfterReorder_Reorganized.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public static class PackageGuids - { - #region Fields - - public const string GuidCodeMaidToolWindowBuildProgressString = "260978c3-582c-487d-ab12-c1fdde07c578"; - public const string GuidCodeMaidToolWindowSpadeString = "75d09b86-471e-4b30-8720-362d13ad0a45"; - public static readonly Guid GuidCodeMaidMenuSolutionExplorerGroup = new Guid("d69f1580-274f-4d12-b13a-c365c759de66"); - public static readonly Guid GuidCodeMaidMenuVisualizeGroup = new Guid("a4ef7624-6477-4860-85bc-46564429f935"); - public static readonly Guid GuidCodeMaidToolWindowBuildProgress = new Guid(GuidCodeMaidToolWindowBuildProgressString); - public static readonly Guid GuidCodeMaidToolWindowSpade = new Guid(GuidCodeMaidToolWindowSpadeString); - - #endregion Fields - } - - public class RegionsInsertAfterReorder - { - #region Fields - - public const int MenuIDCodeMaidContextSpade = 0x1060; - public const int ToolbarIDCodeMaidToolbarSpade = 0x1040; - - #endregion Fields - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmpty.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmpty.cs deleted file mode 100644 index d8e97dbb0..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmpty.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsInsertEvenIfEmpty - { - public const int PublicConstant = 1; - - public int PublicField; - - internal const int InternalConstant = 1; - - internal int InternalField; - - private const int PrivateConstant = 3; - - private int PrivateField; - - #region Constructors - - public RegionsInsertEvenIfEmpty() - { - } - - protected RegionsInsertEvenIfEmpty(int param) - { - } - - #endregion Constructors - - public delegate void PublicDelegate(); - - internal delegate void InternalDelegate(); - - protected delegate void ProtectedDelegate(); - - private delegate void PrivateDelegate(); - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - internal event EventHandler InternalEvent2; - - private event EventHandler PrivateEvent; - - public enum PublicEnum - { - Item1, - Item2 - } - - #region Methods - - public void PublicMethod() - { - } - - protected void ProtectedMethod() - { - } - - #endregion Methods - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyClass.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyClass.cs deleted file mode 100644 index 97b0604c1..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyClass.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsInsertEvenIfEmptyWithEmptyClass - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyClass_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyClass_Reorganized.cs deleted file mode 100644 index 200874ca5..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyClass_Reorganized.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsInsertEvenIfEmptyWithEmptyClass - { - #region Fields - - #endregion Fields - - #region Constructors - - #endregion Constructors - - #region Destructors - - #endregion Destructors - - #region Delegates - - #endregion Delegates - - #region Events - - #endregion Events - - #region Enums - - #endregion Enums - - #region Interfaces - - #endregion Interfaces - - #region Properties - - #endregion Properties - - #region Indexers - - #endregion Indexers - - #region Methods - - #endregion Methods - - #region Structs - - #endregion Structs - - #region Classes - - #endregion Classes - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyRegion.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyRegion.cs deleted file mode 100644 index 662db451a..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyRegion.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsInsertEvenIfEmptyWithEmptyRegion - { - #region Methods - - #endregion Methods - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyRegion_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyRegion_Reorganized.cs deleted file mode 100644 index d7808bb85..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmptyWithEmptyRegion_Reorganized.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsInsertEvenIfEmptyWithEmptyRegion - { - #region Fields - - #endregion Fields - - #region Constructors - - #endregion Constructors - - #region Destructors - - #endregion Destructors - - #region Delegates - - #endregion Delegates - - #region Events - - #endregion Events - - #region Enums - - #endregion Enums - - #region Interfaces - - #endregion Interfaces - - #region Properties - - #endregion Properties - - #region Indexers - - #endregion Indexers - - #region Methods - - #endregion Methods - - #region Structs - - #endregion Structs - - #region Classes - - #endregion Classes - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmpty_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmpty_Reorganized.cs deleted file mode 100644 index 289fb6a71..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertEvenIfEmpty_Reorganized.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsInsertEvenIfEmpty - { - #region Fields - - public const int PublicConstant = 1; - - public int PublicField; - - internal const int InternalConstant = 1; - - internal int InternalField; - - private const int PrivateConstant = 3; - - private int PrivateField; - - #endregion Fields - - #region Constructors - - public RegionsInsertEvenIfEmpty() - { - } - - protected RegionsInsertEvenIfEmpty(int param) - { - } - - #endregion Constructors - - #region Destructors - - #endregion Destructors - - #region Delegates - - public delegate void PublicDelegate(); - - internal delegate void InternalDelegate(); - - protected delegate void ProtectedDelegate(); - - private delegate void PrivateDelegate(); - - #endregion Delegates - - #region Events - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - internal event EventHandler InternalEvent2; - - private event EventHandler PrivateEvent; - - #endregion Events - - #region Enums - - public enum PublicEnum - { - Item1, - Item2 - } - - #endregion Enums - - #region Interfaces - - #endregion Interfaces - - #region Properties - - #endregion Properties - - #region Indexers - - #endregion Indexers - - #region Methods - - public void PublicMethod() - { - } - - protected void ProtectedMethod() - { - } - - #endregion Methods - - #region Structs - - #endregion Structs - - #region Classes - - #endregion Classes - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertStandard.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertStandard.cs deleted file mode 100644 index e0c760d68..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertStandard.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.ComponentModel; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsInsertStandard : INotifyPropertyChanged - { - public const int PublicConstant = 1; - - public int PublicField; - - internal const int InternalConstant = 1; - - internal int InternalField; - - private const int PrivateConstant = 3; - - private int PrivateField; - - #region Constructors - - public RegionsInsertStandard() - { - } - - protected RegionsInsertStandard(int param) - { - } - - #endregion Constructors - - public delegate void PublicDelegate(); - - internal delegate void InternalDelegate(); - - protected delegate void ProtectedDelegate(); - - private delegate void PrivateDelegate(); - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - internal event EventHandler InternalEvent2; - - private event EventHandler PrivateEvent; - - public enum PublicEnum - { - Item1, - Item2 - } - - #region Interfaces - - public interface PublicInterface - { - } - - protected interface ProtectedInterface - { - } - - #endregion Interfaces - - #region Implementation of INotifyPropertyChanged - - public event PropertyChangedEventHandler PropertyChanged; - - public void OnPropertyChanged(string propertyName) - { - if (PropertyChanged != null) - { - PropertyChanged(this, new PropertyChangedEventArgs(name)); - } - } - - #endregion Implementation of INotifyPropertyChanged - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertStandard_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertStandard_Reorganized.cs deleted file mode 100644 index b9d558872..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertStandard_Reorganized.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.ComponentModel; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsInsertStandard : INotifyPropertyChanged - { - #region Fields - - public const int PublicConstant = 1; - - public int PublicField; - - internal const int InternalConstant = 1; - - internal int InternalField; - - private const int PrivateConstant = 3; - - private int PrivateField; - - #endregion Fields - - #region Constructors - - public RegionsInsertStandard() - { - } - - protected RegionsInsertStandard(int param) - { - } - - #endregion Constructors - - #region Delegates - - public delegate void PublicDelegate(); - - internal delegate void InternalDelegate(); - - protected delegate void ProtectedDelegate(); - - private delegate void PrivateDelegate(); - - #endregion Delegates - - #region Events - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - internal event EventHandler InternalEvent2; - - private event EventHandler PrivateEvent; - - #endregion Events - - #region Enums - - public enum PublicEnum - { - Item1, - Item2 - } - - #endregion Enums - - #region Interfaces - - public interface PublicInterface - { - } - - protected interface ProtectedInterface - { - } - - #endregion Interfaces - - #region Implementation of INotifyPropertyChanged - - public event PropertyChangedEventHandler PropertyChanged; - - public void OnPropertyChanged(string propertyName) - { - if (PropertyChanged != null) - { - PropertyChanged(this, new PropertyChangedEventArgs(name)); - } - } - - #endregion Implementation of INotifyPropertyChanged - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertWithAccessModifiers.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertWithAccessModifiers.cs deleted file mode 100644 index d9c4995d9..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertWithAccessModifiers.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsInsertWithAccessModifiers - { - public const int PublicConstant = 1; - - public int PublicField; - - internal const int InternalConstant = 1; - - internal int InternalField; - - private const int PrivateConstant = 3; - - private int PrivateField; - - #region Constructors - - public RegionsInsertWithAccessModifiers() - { - } - - protected RegionsInsertWithAccessModifiers(int param) - { - } - - #endregion Constructors - - public delegate void PublicDelegate(); - - internal delegate void InternalDelegate(); - - protected delegate void ProtectedDelegate(); - - private delegate void PrivateDelegate(); - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - internal event EventHandler InternalEvent2; - - private event EventHandler PrivateEvent; - - public enum PublicEnum - { - Item1, - Item2 - } - - #region Interfaces - - public interface PublicInterface - { - } - - protected interface ProtectedInterface - { - } - - #endregion Interfaces - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertWithAccessModifiers_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertWithAccessModifiers_Reorganized.cs deleted file mode 100644 index b85835a18..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsInsertWithAccessModifiers_Reorganized.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsInsertWithAccessModifiers - { - #region Public Fields - - public const int PublicConstant = 1; - - public int PublicField; - - #endregion Public Fields - - #region Internal Fields - - internal const int InternalConstant = 1; - - internal int InternalField; - - #endregion Internal Fields - - #region Private Fields - - private const int PrivateConstant = 3; - - private int PrivateField; - - #endregion Private Fields - - #region Constructors - - public RegionsInsertWithAccessModifiers() - { - } - - protected RegionsInsertWithAccessModifiers(int param) - { - } - - #endregion Constructors - - #region Public Delegates - - public delegate void PublicDelegate(); - - #endregion Public Delegates - - #region Internal Delegates - - internal delegate void InternalDelegate(); - - #endregion Internal Delegates - - #region Protected Delegates - - protected delegate void ProtectedDelegate(); - - #endregion Protected Delegates - - #region Private Delegates - - private delegate void PrivateDelegate(); - - #endregion Private Delegates - - #region Public Events - - public event EventHandler PublicEvent; - - #endregion Public Events - - #region Internal Events - - internal event EventHandler InternalEvent; - - internal event EventHandler InternalEvent2; - - #endregion Internal Events - - #region Private Events - - private event EventHandler PrivateEvent; - - #endregion Private Events - - #region Public Enums - - public enum PublicEnum - { - Item1, - Item2 - } - - #endregion Public Enums - - #region Interfaces - - public interface PublicInterface - { - } - - protected interface ProtectedInterface - { - } - - #endregion Interfaces - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsNewMemberOutside.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsNewMemberOutside.cs deleted file mode 100644 index 74bb4a65a..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsNewMemberOutside.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsNewMemberOutside - { - #region Public Constructors - - public RegionsNewMemberOutside() - { - } - - #endregion Public Constructors - - #region Public Properties - - public bool IsIssue { get; set; } - - #endregion Public Properties - - #region Public Methods - - public void Test() - { - } - - #endregion Public Methods - - #region Private Methods - - private void DoTest() - { - } - - #endregion Private Methods - - public void Test2() - { - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsNewMemberOutside_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsNewMemberOutside_Reorganized.cs deleted file mode 100644 index 063bc4942..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsNewMemberOutside_Reorganized.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsNewMemberOutside - { - - #region Public Constructors - - public RegionsNewMemberOutside() - { - } - - #endregion Public Constructors - - #region Public Properties - - public bool IsIssue { get; set; } - - #endregion Public Properties - - #region Public Methods - - public void Test() - { - } - - public void Test2() - { - } - - #endregion Public Methods - - #region Private Methods - - private void DoTest() - { - } - - #endregion Private Methods - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithAccessModifiers.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithAccessModifiers.cs deleted file mode 100644 index b1d0c80fd..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithAccessModifiers.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsRemoveAndInsertWithAccessModifiers - { - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - /// The hosting package. - internal RegionsRemoveAndInsertWithAccessModifiers(CodeMaidPackage package) - { - #region RegionsInMethodsShouldBeIgnored - - Package = package; - - StartTracking(); - - #endregion RegionsInMethodsShouldBeIgnored - } - - #endregion Constructors - - #region Internal Methods - - /// - /// Starts tracking the active document. - /// - internal void StartTracking() - { - // Cache the active document. - TrackedDocument = Package.ActiveDocument; - } - - /// - /// Restores the tracked document if not already active. - /// - internal void RestoreTrackedDocument() - { - if (TrackedDocument != null && Package.ActiveDocument != TrackedDocument) - { - TrackedDocument.Activate(); - } - } - - #endregion Internal Methods - - #region IDisposable Members - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting - /// unmanaged resources. - /// - public void Dispose() - { - RestoreTrackedDocument(); - } - - #endregion IDisposable Members - - #region Private Properties - - /// - /// Gets or sets the hosting package. - /// - private CodeMaidPackage Package { get; set; } - - /// - /// Gets or sets the active document. - /// - private Document TrackedDocument { get; set; } - - #endregion Private Properties - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithAccessModifiers_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithAccessModifiers_Reorganized.cs deleted file mode 100644 index 05e427e25..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithAccessModifiers_Reorganized.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsRemoveAndInsertWithAccessModifiers - { - - #region Internal Constructors - - /// - /// Initializes a new instance of the class. - /// - /// The hosting package. - internal RegionsRemoveAndInsertWithAccessModifiers(CodeMaidPackage package) - { - #region RegionsInMethodsShouldBeIgnored - - Package = package; - - StartTracking(); - - #endregion RegionsInMethodsShouldBeIgnored - } - - #endregion Internal Constructors - - #region Private Properties - - /// - /// Gets or sets the hosting package. - /// - private CodeMaidPackage Package { get; set; } - - /// - /// Gets or sets the active document. - /// - private Document TrackedDocument { get; set; } - - #endregion Private Properties - - #region Public Methods - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting - /// unmanaged resources. - /// - public void Dispose() - { - RestoreTrackedDocument(); - } - - #endregion Public Methods - - #region Internal Methods - - /// - /// Restores the tracked document if not already active. - /// - internal void RestoreTrackedDocument() - { - if (TrackedDocument != null && Package.ActiveDocument != TrackedDocument) - { - TrackedDocument.Activate(); - } - } - - /// - /// Starts tracking the active document. - /// - internal void StartTracking() - { - // Cache the active document. - TrackedDocument = Package.ActiveDocument; - } - - #endregion Internal Methods - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithoutAccessModifiers.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithoutAccessModifiers.cs deleted file mode 100644 index 5558bc798..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithoutAccessModifiers.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsRemoveAndInsertWithoutAccessModifiers - { - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - /// The hosting package. - internal RegionsRemoveAndInsertWithoutAccessModifiers(CodeMaidPackage package) - { - #region RegionsInMethodsShouldBeIgnored - - Package = package; - - StartTracking(); - - #endregion RegionsInMethodsShouldBeIgnored - } - - #endregion Constructors - - #region Internal Methods - - /// - /// Starts tracking the active document. - /// - internal void StartTracking() - { - // Cache the active document. - TrackedDocument = Package.ActiveDocument; - } - - /// - /// Restores the tracked document if not already active. - /// - internal void RestoreTrackedDocument() - { - if (TrackedDocument != null && Package.ActiveDocument != TrackedDocument) - { - TrackedDocument.Activate(); - } - } - - #endregion Internal Methods - - #region IDisposable Members - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting - /// unmanaged resources. - /// - public void Dispose() - { - RestoreTrackedDocument(); - } - - #endregion IDisposable Members - - #region Private Properties - - /// - /// Gets or sets the hosting package. - /// - private CodeMaidPackage Package { get; set; } - - /// - /// Gets or sets the active document. - /// - private Document TrackedDocument { get; set; } - - #endregion Private Properties - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithoutAccessModifiers_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithoutAccessModifiers_Reorganized.cs deleted file mode 100644 index fbf3ef424..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveAndInsertWithoutAccessModifiers_Reorganized.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsRemoveAndInsertWithoutAccessModifiers - { - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - /// The hosting package. - internal RegionsRemoveAndInsertWithoutAccessModifiers(CodeMaidPackage package) - { - #region RegionsInMethodsShouldBeIgnored - - Package = package; - - StartTracking(); - - #endregion RegionsInMethodsShouldBeIgnored - } - - #endregion Constructors - - #region Properties - - /// - /// Gets or sets the hosting package. - /// - private CodeMaidPackage Package { get; set; } - - /// - /// Gets or sets the active document. - /// - private Document TrackedDocument { get; set; } - - #endregion Properties - - #region Methods - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting - /// unmanaged resources. - /// - public void Dispose() - { - RestoreTrackedDocument(); - } - - /// - /// Restores the tracked document if not already active. - /// - internal void RestoreTrackedDocument() - { - if (TrackedDocument != null && Package.ActiveDocument != TrackedDocument) - { - TrackedDocument.Activate(); - } - } - - /// - /// Starts tracking the active document. - /// - internal void StartTracking() - { - // Cache the active document. - TrackedDocument = Package.ActiveDocument; - } - - #endregion Methods - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveExisting.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveExisting.cs deleted file mode 100644 index a057e699f..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveExisting.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsRemoveExisting - { - #region Arbitrary One Item Region - - public const int PublicConstant = 1; - - #endregion Arbitrary One Item Region - - public int PublicField; - - #region Arbitrary Multiple Item Region - - internal const int InternalConstant = 1; - - internal int InternalField; - - private const int PrivateConstant = 3; - - private int PrivateField; - - #endregion Arbitrary Multiple Item Region - - #region Constructors - - public RegionsRemoveExisting() - { - #region RegionsInMethodsShouldBeIgnored - - #endregion RegionsInMethodsShouldBeIgnored - } - - protected RegionsRemoveExisting(int param) - { - } - - #endregion Constructors - - #region Arbitrary Nested Parent Region - - public delegate void PublicDelegate(); - - internal delegate void InternalDelegate(); - - protected delegate void ProtectedDelegate(); - - private delegate void PrivateDelegate(); - - #region Arbitrary Nested Child Region - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - internal event EventHandler InternalEvent2; - - private event EventHandler PrivateEvent; - - #endregion Arbitrary Nested Child Region - - public enum PublicEnum - { - Item1, - Item2 - } - - #endregion Arbitrary Nested Parent Region - - #region Interfaces - - public interface PublicInterface - { - } - - protected interface ProtectedInterface - { - } - - #endregion Interfaces - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveExisting_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveExisting_Reorganized.cs deleted file mode 100644 index 797dff5d8..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/RegionsRemoveExisting_Reorganized.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class RegionsRemoveExisting - { - - public const int PublicConstant = 1; - - public int PublicField; - - internal const int InternalConstant = 1; - - internal int InternalField; - - private const int PrivateConstant = 3; - - private int PrivateField; - - #region Constructors - - public RegionsRemoveExisting() - { - #region RegionsInMethodsShouldBeIgnored - - #endregion RegionsInMethodsShouldBeIgnored - } - - protected RegionsRemoveExisting(int param) - { - } - - #endregion Constructors - - public delegate void PublicDelegate(); - - internal delegate void InternalDelegate(); - - protected delegate void ProtectedDelegate(); - - private delegate void PrivateDelegate(); - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - internal event EventHandler InternalEvent2; - - private event EventHandler PrivateEvent; - - public enum PublicEnum - { - Item1, - Item2 - } - - #region Interfaces - - public interface PublicInterface - { - } - - protected interface ProtectedInterface - { - } - - #endregion Interfaces - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/ReorganizationAvailability.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/ReorganizationAvailability.cs deleted file mode 100644 index b07843960..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/ReorganizationAvailability.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class ReorganizationAvailability - { - private static void Main(string[] args) - { -#if DEBUG - Debug(); -#endif - Always(); - } - -#if DEBUG - - private static void Debug() - { - Console.WriteLine("BUGS"); - } - -#endif - - public static void Always() - { - Console.WriteLine("Defect free code"); - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomGrouping.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomGrouping.cs deleted file mode 100644 index 6fb5816b2..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomGrouping.cs +++ /dev/null @@ -1,221 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class TypeCustomGrouping - { - public const int PublicConstant = 1; - - public int PublicField; - - internal const int InternalConstant = 1; - - internal int InternalField; - - protected const int ProtectedConstant = 2; - - protected int ProtectedField; - - private const int PrivateConstant = 3; - - private int PrivateField; - - static TypeCustomGrouping() - { - } - - public TypeCustomGrouping() - { - } - - internal TypeCustomGrouping(bool param) - { - } - - protected TypeCustomGrouping(int param) - { - } - - private TypeCustomGrouping(string param) - { - } - - public ~TypeCustomGrouping() - { - } - - internal ~TypeCustomGrouping() - { - } - - protected ~TypeCustomGrouping() - { - } - - private ~TypeCustomGrouping() - { - } - - public delegate void PublicDelegate(); - - internal delegate void InternalDelegate(); - - protected delegate void ProtectedDelegate(); - - private delegate void PrivateDelegate(); - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - protected event EventHandler ProtectedEvent; - - private event EventHandler PrivateEvent; - - public enum PublicEnum - { - Item1, - Item2 - } - - internal enum InternalEnum - { - } - - protected enum ProtectedEnum - { - } - - private enum PrivateEnum - { - } - - public interface PublicInterface - { - } - - internal interface InternalInterface - { - } - - protected interface ProtectedInterface - { - } - - private interface PrivateInterface - { - } - - public static string PublicStaticProperty { get; set; } - - public string PublicProperty { get; set; } - - internal static string InternalStaticProperty { get; } - - internal string InternalProperty { get; } - - protected static string ProtectedStaticProperty { set; } - - protected string ProtectedProperty { set; } - - private static string PrivateStaticProperty { get; set; } - - private string PrivateProperty { get; set; } - - public static void PublicStaticMethod() - { - } - - public void PublicMethod() - { - } - - public void PublicOverloadedMethod() - { - } - - public void PublicOverloadedMethod(string input) - { - } - - internal static void InternalStaticMethod() - { - } - - internal void InternalMethod() - { - } - - internal void InternalOverloadedMethod() - { - } - - internal void InternalOverloadedMethod(string input) - { - } - - protected static void ProtectedStaticMethod() - { - } - - protected void ProtectedMethod() - { - } - - protected void ProtectedOverloadedMethod() - { - } - - protected void ProtectedOverloadedMethod(string input) - { - } - - private static void PrivateStaticMethod() - { - } - - private void PrivateMethod() - { - } - - private void PrivateOverloadedMethod() - { - } - - private void PrivateOverloadedMethod(string input) - { - } - - public struct PublicStruct - { - } - - internal struct InternalStruct - { - } - - protected struct ProtectedStruct - { - } - - private struct PrivateStruct - { - } - - public class PublicClass - { - } - - internal class InternalClass - { - } - - protected class ProtectedClass - { - } - - private class PrivateClass - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomGrouping_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomGrouping_Reorganized.cs deleted file mode 100644 index 8d8d4dbf7..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomGrouping_Reorganized.cs +++ /dev/null @@ -1,220 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class TypeCustomGrouping - { - public const int PublicConstant = 1; - - public int PublicField; - - internal const int InternalConstant = 1; - - internal int InternalField; - - protected const int ProtectedConstant = 2; - - protected int ProtectedField; - - private const int PrivateConstant = 3; - - private int PrivateField; - - static TypeCustomGrouping() - { - } - - public TypeCustomGrouping() - { - } - - internal TypeCustomGrouping(bool param) - { - } - - protected TypeCustomGrouping(int param) - { - } - - private TypeCustomGrouping(string param) - { - } - - public ~TypeCustomGrouping() - { - } - - internal ~TypeCustomGrouping() - { - } - - protected ~TypeCustomGrouping() - { - } - - private ~TypeCustomGrouping() - { - } - - public static void PublicStaticMethod() - { - } - - public delegate void PublicDelegate(); - - public void PublicMethod() - { - } - - public void PublicOverloadedMethod() - { - } - - public void PublicOverloadedMethod(string input) - { - } - - internal static void InternalStaticMethod() - { - } - - internal delegate void InternalDelegate(); - - internal void InternalMethod() - { - } - - internal void InternalOverloadedMethod() - { - } - - internal void InternalOverloadedMethod(string input) - { - } - - protected static void ProtectedStaticMethod() - { - } - - protected delegate void ProtectedDelegate(); - - protected void ProtectedMethod() - { - } - - protected void ProtectedOverloadedMethod() - { - } - - protected void ProtectedOverloadedMethod(string input) - { - } - - private static void PrivateStaticMethod() - { - } - - private delegate void PrivateDelegate(); - - private void PrivateMethod() - { - } - - private void PrivateOverloadedMethod() - { - } - - private void PrivateOverloadedMethod(string input) - { - } - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - protected event EventHandler ProtectedEvent; - - private event EventHandler PrivateEvent; - - public enum PublicEnum - { - Item1, - Item2 - } - - internal enum InternalEnum - { - } - - protected enum ProtectedEnum - { - } - - private enum PrivateEnum - { - } - - public interface PublicInterface - { - } - - internal interface InternalInterface - { - } - - protected interface ProtectedInterface - { - } - - private interface PrivateInterface - { - } - - public static string PublicStaticProperty { get; set; } - - public string PublicProperty { get; set; } - - internal static string InternalStaticProperty { get; } - - internal string InternalProperty { get; } - - protected static string ProtectedStaticProperty { set; } - - protected string ProtectedProperty { set; } - - private static string PrivateStaticProperty { get; set; } - - private string PrivateProperty { get; set; } - public struct PublicStruct - { - } - - internal struct InternalStruct - { - } - - protected struct ProtectedStruct - { - } - - private struct PrivateStruct - { - } - - public class PublicClass - { - } - - internal class InternalClass - { - } - - protected class ProtectedClass - { - } - - private class PrivateClass - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomOrder.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomOrder.cs deleted file mode 100644 index ba5b1df90..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomOrder.cs +++ /dev/null @@ -1,221 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class TypeCustomOrder - { - public const int PublicConstant = 1; - - public int PublicField; - - internal const int InternalConstant = 1; - - internal int InternalField; - - protected const int ProtectedConstant = 2; - - protected int ProtectedField; - - private const int PrivateConstant = 3; - - private int PrivateField; - - static TypeCustomOrder() - { - } - - public TypeCustomOrder() - { - } - - internal TypeCustomOrder(bool param) - { - } - - protected TypeCustomOrder(int param) - { - } - - private TypeCustomOrder(string param) - { - } - - public ~TypeCustomOrder() - { - } - - internal ~TypeCustomOrder() - { - } - - protected ~TypeCustomOrder() - { - } - - private ~TypeCustomOrder() - { - } - - public delegate void PublicDelegate(); - - internal delegate void InternalDelegate(); - - protected delegate void ProtectedDelegate(); - - private delegate void PrivateDelegate(); - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - protected event EventHandler ProtectedEvent; - - private event EventHandler PrivateEvent; - - public enum PublicEnum - { - Item1, - Item2 - } - - internal enum InternalEnum - { - } - - protected enum ProtectedEnum - { - } - - private enum PrivateEnum - { - } - - public interface PublicInterface - { - } - - internal interface InternalInterface - { - } - - protected interface ProtectedInterface - { - } - - private interface PrivateInterface - { - } - - public static string PublicStaticProperty { get; set; } - - public string PublicProperty { get; set; } - - internal static string InternalStaticProperty { get; } - - internal string InternalProperty { get; } - - protected static string ProtectedStaticProperty { set; } - - protected string ProtectedProperty { set; } - - private static string PrivateStaticProperty { get; set; } - - private string PrivateProperty { get; set; } - - public static void PublicStaticMethod() - { - } - - public void PublicMethod() - { - } - - public void PublicOverloadedMethod() - { - } - - public void PublicOverloadedMethod(string input) - { - } - - internal static void InternalStaticMethod() - { - } - - internal void InternalMethod() - { - } - - internal void InternalOverloadedMethod() - { - } - - internal void InternalOverloadedMethod(string input) - { - } - - protected static void ProtectedStaticMethod() - { - } - - protected void ProtectedMethod() - { - } - - protected void ProtectedOverloadedMethod() - { - } - - protected void ProtectedOverloadedMethod(string input) - { - } - - private static void PrivateStaticMethod() - { - } - - private void PrivateMethod() - { - } - - private void PrivateOverloadedMethod() - { - } - - private void PrivateOverloadedMethod(string input) - { - } - - public struct PublicStruct - { - } - - internal struct InternalStruct - { - } - - protected struct ProtectedStruct - { - } - - private struct PrivateStruct - { - } - - public class PublicClass - { - } - - internal class InternalClass - { - } - - protected class ProtectedClass - { - } - - private class PrivateClass - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomOrder_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomOrder_Reorganized.cs deleted file mode 100644 index 4e0aafbc1..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/TypeCustomOrder_Reorganized.cs +++ /dev/null @@ -1,212 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class TypeCustomOrder - { - static TypeCustomOrder() - { - } - - public TypeCustomOrder() - { - } - - internal TypeCustomOrder(bool param) - { - } - - protected TypeCustomOrder(int param) - { - } - - private TypeCustomOrder(string param) - { - } - - public delegate void PublicDelegate(); - - internal delegate void InternalDelegate(); - - protected delegate void ProtectedDelegate(); - - private delegate void PrivateDelegate(); - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - protected event EventHandler ProtectedEvent; - - private event EventHandler PrivateEvent; - - public enum PublicEnum - { - Item1, - Item2 - } - - internal enum InternalEnum - { - } - - protected enum ProtectedEnum - { - } - - private enum PrivateEnum - { - } - - public interface PublicInterface - { - } - - internal interface InternalInterface - { - } - - protected interface ProtectedInterface - { - } - - private interface PrivateInterface - { - } - - public static string PublicStaticProperty { get; set; } - public string PublicProperty { get; set; } - internal static string InternalStaticProperty { get; } - internal string InternalProperty { get; } - protected static string ProtectedStaticProperty { set; } - protected string ProtectedProperty { set; } - private static string PrivateStaticProperty { get; set; } - private string PrivateProperty { get; set; } - public static void PublicStaticMethod() - { - } - - public void PublicMethod() - { - } - - public void PublicOverloadedMethod() - { - } - - public void PublicOverloadedMethod(string input) - { - } - - internal static void InternalStaticMethod() - { - } - - internal void InternalMethod() - { - } - - internal void InternalOverloadedMethod() - { - } - - internal void InternalOverloadedMethod(string input) - { - } - - protected static void ProtectedStaticMethod() - { - } - - protected void ProtectedMethod() - { - } - - protected void ProtectedOverloadedMethod() - { - } - - protected void ProtectedOverloadedMethod(string input) - { - } - - private static void PrivateStaticMethod() - { - } - - private void PrivateMethod() - { - } - - private void PrivateOverloadedMethod() - { - } - - private void PrivateOverloadedMethod(string input) - { - } - - public struct PublicStruct - { - } - - internal struct InternalStruct - { - } - - protected struct ProtectedStruct - { - } - - private struct PrivateStruct - { - } - - public class PublicClass - { - } - - internal class InternalClass - { - } - - protected class ProtectedClass - { - } - - private class PrivateClass - { - } - - public const int PublicConstant = 1; - - public int PublicField; - - internal const int InternalConstant = 1; - - internal int InternalField; - - protected const int ProtectedConstant = 2; - - protected int ProtectedField; - - private const int PrivateConstant = 3; - - private int PrivateField; - public ~TypeCustomOrder() - { - } - - internal ~TypeCustomOrder() - { - } - - protected ~TypeCustomOrder() - { - } - - private ~TypeCustomOrder() - { - } - } -} diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/TypeDefaultOrder.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/TypeDefaultOrder.cs deleted file mode 100644 index 41e20eb77..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/TypeDefaultOrder.cs +++ /dev/null @@ -1,209 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class TypeDefaultOrder - { - public const int PublicConstant = 1; - - public int PublicField; - - protected delegate void ProtectedDelegate(); - - private const int PrivateConstant = 3; - - public interface PublicInterface - { - } - - private int PrivateField; - - public TypeDefaultOrder() - { - } - - internal event EventHandler InternalEvent; - - internal TypeDefaultOrder(bool param) - { - } - - internal const int InternalConstant = 1; - - internal delegate void InternalDelegate(); - - protected TypeDefaultOrder(int param) - { - } - - protected interface ProtectedInterface - { - } - - public delegate void PublicDelegate(); - - private delegate void PrivateDelegate(); - - public event EventHandler PublicEvent; - - internal int InternalField; - - private event EventHandler PrivateEvent; - - public enum PublicEnum - { - Item1, - Item2 - } - - internal enum InternalEnum - { - } - - private enum PrivateEnum - { - } - - internal interface InternalInterface - { - } - - protected string ProtectedProperty { set; } - - private interface PrivateInterface - { - } - - public static string PublicStaticProperty { get; set; } - - protected int ProtectedField; - - protected static void ProtectedStaticMethod() - { - } - - internal void InternalOverloadedMethod() - { - } - - public string PublicProperty { get; set; } - - public ~TypeDefaultOrder() - { - } - - private void PrivateOverloadedMethod(string input) - { - } - - internal string InternalProperty { get; } - - public void PublicMethod() - { - } - - protected static string ProtectedStaticProperty { set; } - - private TypeDefaultOrder(string param) - { - } - - internal static void InternalStaticMethod() - { - } - - protected enum ProtectedEnum - { - } - - protected void ProtectedOverloadedMethod() - { - } - - protected event EventHandler ProtectedEvent; - - private static string PrivateStaticProperty { get; set; } - - protected class ProtectedClass - { - } - - private string PrivateProperty { get; set; } - - public static void PublicStaticMethod() - { - } - - public struct PublicStruct - { - } - - static TypeDefaultOrder() - { - } - - public void PublicOverloadedMethod() - { - } - - protected void ProtectedMethod() - { - } - - public void PublicOverloadedMethod(string input) - { - } - - internal void InternalMethod() - { - } - - internal static string InternalStaticProperty { get; } - - protected void ProtectedOverloadedMethod(string input) - { - } - - protected struct ProtectedStruct - { - } - - public class PublicClass - { - } - - private static void PrivateStaticMethod() - { - } - - private void PrivateMethod() - { - } - - private void PrivateOverloadedMethod() - { - } - - internal struct InternalStruct - { - } - - internal void InternalOverloadedMethod(string input) - { - } - - private struct PrivateStruct - { - } - - protected const int ProtectedConstant = 2; - - internal class InternalClass - { - } - - private class PrivateClass - { - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/Data/TypeDefaultOrder_Reorganized.cs b/CodeMaid.IntegrationTests/Reorganizing/Data/TypeDefaultOrder_Reorganized.cs deleted file mode 100644 index 31e596d16..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/Data/TypeDefaultOrder_Reorganized.cs +++ /dev/null @@ -1,197 +0,0 @@ -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing.Data -{ - public class TypeDefaultOrder - { - public const int PublicConstant = 1; - - public int PublicField; - - internal const int InternalConstant = 1; - - internal int InternalField; - - protected const int ProtectedConstant = 2; - - protected int ProtectedField; - - private const int PrivateConstant = 3; - - private int PrivateField; - - static TypeDefaultOrder() - { - } - - public TypeDefaultOrder() - { - } - - internal TypeDefaultOrder(bool param) - { - } - - protected TypeDefaultOrder(int param) - { - } - - private TypeDefaultOrder(string param) - { - } - - public ~TypeDefaultOrder() - { - } - - public delegate void PublicDelegate(); - - internal delegate void InternalDelegate(); - - protected delegate void ProtectedDelegate(); - private delegate void PrivateDelegate(); - - public event EventHandler PublicEvent; - - internal event EventHandler InternalEvent; - - protected event EventHandler ProtectedEvent; - - private event EventHandler PrivateEvent; - - public enum PublicEnum - { - Item1, - Item2 - } - - internal enum InternalEnum - { - } - - protected enum ProtectedEnum - { - } - - private enum PrivateEnum - { - } - - public interface PublicInterface - { - } - internal interface InternalInterface - { - } - - protected interface ProtectedInterface - { - } - private interface PrivateInterface - { - } - - public static string PublicStaticProperty { get; set; } - public string PublicProperty { get; set; } - internal static string InternalStaticProperty { get; } - internal string InternalProperty { get; } - protected static string ProtectedStaticProperty { set; } - protected string ProtectedProperty { set; } - private static string PrivateStaticProperty { get; set; } - - private string PrivateProperty { get; set; } - - public static void PublicStaticMethod() - { - } - - public void PublicMethod() - { - } - - public void PublicOverloadedMethod() - { - } - - public void PublicOverloadedMethod(string input) - { - } - - internal static void InternalStaticMethod() - { - } - - internal void InternalMethod() - { - } - - internal void InternalOverloadedMethod() - { - } - - internal void InternalOverloadedMethod(string input) - { - } - - protected static void ProtectedStaticMethod() - { - } - protected void ProtectedMethod() - { - } - - protected void ProtectedOverloadedMethod() - { - } - - protected void ProtectedOverloadedMethod(string input) - { - } - - private static void PrivateStaticMethod() - { - } - - private void PrivateMethod() - { - } - - private void PrivateOverloadedMethod(string input) - { - } - private void PrivateOverloadedMethod() - { - } - - public struct PublicStruct - { - } - - internal struct InternalStruct - { - } - - protected struct ProtectedStruct - { - } - - private struct PrivateStruct - { - } - - public class PublicClass - { - } - - internal class InternalClass - { - } - - protected class ProtectedClass - { - } - private class PrivateClass - { - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertAfterReorderTests.cs b/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertAfterReorderTests.cs deleted file mode 100644 index 1e2f71552..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertAfterReorderTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\RegionsInsertAfterReorder.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\RegionsInsertAfterReorder_Reorganized.cs", "Data")] - public class RegionsInsertAfterReorderTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RegionsInsertAfterReorder.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertAfterReorder_ReorganizesAsExpected() - { - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\RegionsInsertAfterReorder_Reorganized.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertAfterReorder_DoesNothingOnSecondPass() - { - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunReorganize, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertEvenIfEmptyTests.cs b/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertEvenIfEmptyTests.cs deleted file mode 100644 index 958944244..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertEvenIfEmptyTests.cs +++ /dev/null @@ -1,84 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\RegionsInsertEvenIfEmpty.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\RegionsInsertEvenIfEmpty_Reorganized.cs", "Data")] - public class RegionsInsertEvenIfEmptyTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RegionsInsertEvenIfEmpty.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertEvenIfEmpty_ReorganizesAsExpected() - { - Settings.Default.Reorganizing_RegionsInsertKeepEvenIfEmpty = true; - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\RegionsInsertEvenIfEmpty_Reorganized.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertEvenIfEmpty_DoesNothingOnSecondPass() - { - Settings.Default.Reorganizing_RegionsInsertKeepEvenIfEmpty = true; - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunReorganize, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertEvenIfEmpty_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Reorganizing_RegionsInsertKeepEvenIfEmpty = false; - Settings.Default.Reorganizing_RegionsInsertNewRegions = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunReorganize, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertEvenIfEmptyWithEmptyClassTests.cs b/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertEvenIfEmptyWithEmptyClassTests.cs deleted file mode 100644 index 0e7ef96bf..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertEvenIfEmptyWithEmptyClassTests.cs +++ /dev/null @@ -1,84 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\RegionsInsertEvenIfEmptyWithEmptyClass.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\RegionsInsertEvenIfEmptyWithEmptyClass_Reorganized.cs", "Data")] - public class RegionsInsertEvenIfEmptyWithEmptyClassTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RegionsInsertEvenIfEmptyWithEmptyClass.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertEvenIfEmptyWithEmptyClass_ReorganizesAsExpected() - { - Settings.Default.Reorganizing_RegionsInsertKeepEvenIfEmpty = true; - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\RegionsInsertEvenIfEmptyWithEmptyClass_Reorganized.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertEvenIfEmptyWithEmptyClass_DoesNothingOnSecondPass() - { - Settings.Default.Reorganizing_RegionsInsertKeepEvenIfEmpty = true; - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunReorganize, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertEvenIfEmptyWithEmptyClass_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Reorganizing_RegionsInsertKeepEvenIfEmpty = false; - Settings.Default.Reorganizing_RegionsInsertNewRegions = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunReorganize, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertEvenIfEmptyWithEmptyRegionTests.cs b/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertEvenIfEmptyWithEmptyRegionTests.cs deleted file mode 100644 index fa33fb44d..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertEvenIfEmptyWithEmptyRegionTests.cs +++ /dev/null @@ -1,84 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\RegionsInsertEvenIfEmptyWithEmptyRegion.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\RegionsInsertEvenIfEmptyWithEmptyRegion_Reorganized.cs", "Data")] - public class RegionsInsertEvenIfEmptyWithEmptyRegionTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RegionsInsertEvenIfEmptyWithEmptyRegion.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertEvenIfEmptyWithEmptyRegion_ReorganizesAsExpected() - { - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - Settings.Default.Reorganizing_RegionsInsertKeepEvenIfEmpty = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\RegionsInsertEvenIfEmptyWithEmptyRegion_Reorganized.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertEvenIfEmptyWithEmptyRegion_DoesNothingOnSecondPass() - { - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - Settings.Default.Reorganizing_RegionsInsertKeepEvenIfEmpty = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunReorganize, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertEvenIfEmptyWithEmptyRegion_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Reorganizing_RegionsInsertNewRegions = false; - Settings.Default.Reorganizing_RegionsInsertKeepEvenIfEmpty = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunReorganize, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertStandardTests.cs b/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertStandardTests.cs deleted file mode 100644 index 6e7ddd866..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertStandardTests.cs +++ /dev/null @@ -1,81 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\RegionsInsertStandard.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\RegionsInsertStandard_Reorganized.cs", "Data")] - public class RegionsInsertStandardTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RegionsInsertStandard.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertStandard_ReorganizesAsExpected() - { - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\RegionsInsertStandard_Reorganized.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertStandard_DoesNothingOnSecondPass() - { - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunReorganize, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertStandard_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Reorganizing_RegionsInsertNewRegions = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunReorganize, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertWithAccessModifiersTests.cs b/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertWithAccessModifiersTests.cs deleted file mode 100644 index ec66d2c73..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/RegionsInsertWithAccessModifiersTests.cs +++ /dev/null @@ -1,84 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\RegionsInsertWithAccessModifiers.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\RegionsInsertWithAccessModifiers_Reorganized.cs", "Data")] - public class RegionsInsertWithAccessModifiersTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RegionsInsertWithAccessModifiers.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertWithAccessModifiers_ReorganizesAsExpected() - { - Settings.Default.Reorganizing_RegionsIncludeAccessLevel = true; - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\RegionsInsertWithAccessModifiers_Reorganized.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertWithAccessModifiers_DoesNothingOnSecondPass() - { - Settings.Default.Reorganizing_RegionsIncludeAccessLevel = true; - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunReorganize, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsInsertWithAccessModifiers_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Reorganizing_RegionsIncludeAccessLevel = false; - Settings.Default.Reorganizing_RegionsInsertNewRegions = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunReorganize, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/RegionsNewMemberOutsideTests.cs b/CodeMaid.IntegrationTests/Reorganizing/RegionsNewMemberOutsideTests.cs deleted file mode 100644 index 314ed064e..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/RegionsNewMemberOutsideTests.cs +++ /dev/null @@ -1,65 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\RegionsNewMemberOutside.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\RegionsNewMemberOutside_Reorganized.cs", "Data")] - public class RegionsNewMemberOutsideTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RegionsNewMemberOutside.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsNewMemberOutside_ReorganizesAsExpected() - { - Settings.Default.Reorganizing_RegionsIncludeAccessLevel = true; - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - Settings.Default.Reorganizing_RegionsRemoveExistingRegions = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\RegionsNewMemberOutside_Reorganized.cs"); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/RegionsRemoveAndInsertWithAccessModifiersTests.cs b/CodeMaid.IntegrationTests/Reorganizing/RegionsRemoveAndInsertWithAccessModifiersTests.cs deleted file mode 100644 index 5a778332c..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/RegionsRemoveAndInsertWithAccessModifiersTests.cs +++ /dev/null @@ -1,65 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\RegionsRemoveAndInsertWithAccessModifiers.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\RegionsRemoveAndInsertWithAccessModifiers_Reorganized.cs", "Data")] - public class RegionsRemoveAndInsertWithAccessModifiersTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RegionsRemoveAndInsertWithAccessModifiers.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsRemoveAndInsertWithAccessModifiers_ReorganizesAsExpected() - { - Settings.Default.Reorganizing_RegionsIncludeAccessLevel = true; - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - Settings.Default.Reorganizing_RegionsRemoveExistingRegions = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\RegionsRemoveAndInsertWithAccessModifiers_Reorganized.cs"); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/RegionsRemoveAndInsertWithoutAccessModifiersTests.cs b/CodeMaid.IntegrationTests/Reorganizing/RegionsRemoveAndInsertWithoutAccessModifiersTests.cs deleted file mode 100644 index b566e11f5..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/RegionsRemoveAndInsertWithoutAccessModifiersTests.cs +++ /dev/null @@ -1,65 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\RegionsRemoveAndInsertWithoutAccessModifiers.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\RegionsRemoveAndInsertWithoutAccessModifiers_Reorganized.cs", "Data")] - public class RegionsRemoveAndInsertWithoutAccessModifiersTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RegionsRemoveAndInsertWithoutAccessModifiers.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsRemoveAndInsertWithoutAccessModifiers_ReorganizesAsExpected() - { - Settings.Default.Reorganizing_RegionsIncludeAccessLevel = false; - Settings.Default.Reorganizing_RegionsInsertNewRegions = true; - Settings.Default.Reorganizing_RegionsRemoveExistingRegions = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\RegionsRemoveAndInsertWithoutAccessModifiers_Reorganized.cs"); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/RegionsRemoveExistingTests.cs b/CodeMaid.IntegrationTests/Reorganizing/RegionsRemoveExistingTests.cs deleted file mode 100644 index f788ce113..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/RegionsRemoveExistingTests.cs +++ /dev/null @@ -1,81 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\RegionsRemoveExisting.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\RegionsRemoveExisting_Reorganized.cs", "Data")] - public class RegionsRemoveExistingTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RegionsRemoveExisting.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsRemoveExisting_ReorganizesAsExpected() - { - Settings.Default.Reorganizing_RegionsRemoveExistingRegions = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\RegionsRemoveExisting_Reorganized.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsRemoveExisting_DoesNothingOnSecondPass() - { - Settings.Default.Reorganizing_RegionsRemoveExistingRegions = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunReorganize, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingRegionsRemoveExisting_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Reorganizing_RegionsRemoveExistingRegions = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunReorganize, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/ReorganizationAvailabilityTests.cs b/CodeMaid.IntegrationTests/Reorganizing/ReorganizationAvailabilityTests.cs deleted file mode 100644 index 71405e647..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/ReorganizationAvailabilityTests.cs +++ /dev/null @@ -1,60 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using System; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\ReorganizationAvailability.cs", "Data")] - public class ReorganizationAvailabilityTests - { - #region Setup - - private static CodeReorganizationAvailabilityLogic _codeReorganizationAvailabilityLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationAvailabilityLogic = CodeReorganizationAvailabilityLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationAvailabilityLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\ReorganizationAvailability.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizationAvailability_DisabledWhenPreprocessorConditionalCompilationDirectivesExist() - { - UIThreadInvoker.Invoke(new Action(() => - { - // Make sure the document is the active document for the environment. - var document = TestOperations.GetActivatedDocument(_projectItem); - Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument); - - // Confirm the code reorganization availability logic is in the expected state. - Assert.IsFalse(_codeReorganizationAvailabilityLogic.CanReorganize(document)); - })); - } - - #endregion Tests - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/TypeCustomGroupingTests.cs b/CodeMaid.IntegrationTests/Reorganizing/TypeCustomGroupingTests.cs deleted file mode 100644 index 4cdc34214..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/TypeCustomGroupingTests.cs +++ /dev/null @@ -1,81 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\TypeCustomGrouping.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\TypeCustomGrouping_Reorganized.cs", "Data")] - public class TypeCustomGroupingTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\TypeCustomGrouping.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingTypeCustomGroups_ReorganizesAsExpected() - { - Settings.Default.Reorganizing_MemberTypeDelegates = @"Delegates||4||Delegates + Methods"; - Settings.Default.Reorganizing_MemberTypeMethods = @"Methods||4||Delegates + Methods"; - - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\TypeCustomGrouping_Reorganized.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingTypeCustomGroups_DoesNothingOnSecondPass() - { - Settings.Default.Reorganizing_MemberTypeDelegates = @"Delegates||4||Delegates + Methods"; - Settings.Default.Reorganizing_MemberTypeMethods = @"Methods||4||Delegates + Methods"; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunReorganize, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingTypeCustomGroups_DoesNothingWhenSettingsAreUnchanged() - { - TestOperations.ExecuteCommandAndVerifyNoChanges(RunReorganize, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/TypeCustomOrderTests.cs b/CodeMaid.IntegrationTests/Reorganizing/TypeCustomOrderTests.cs deleted file mode 100644 index 21d340bca..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/TypeCustomOrderTests.cs +++ /dev/null @@ -1,81 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\TypeCustomOrder.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\TypeCustomOrder_Reorganized.cs", "Data")] - public class TypeCustomOrderTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\TypeCustomOrder.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingTypeCustomOrder_ReorganizesAsExpected() - { - Settings.Default.Reorganizing_MemberTypeDestructors = @"Destructors||14||Destructors"; - Settings.Default.Reorganizing_MemberTypeFields = @"Fields||13||Fields"; - - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\TypeCustomOrder_Reorganized.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingTypeCustomOrder_DoesNothingOnSecondPass() - { - Settings.Default.Reorganizing_MemberTypeDestructors = @"Destructors||14||Destructors"; - Settings.Default.Reorganizing_MemberTypeFields = @"Fields||13||Fields"; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunReorganize, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingTypeCustomOrder_DoesNothingWhenSettingsAreUnchanged() - { - TestOperations.ExecuteCommandAndVerifyNoChanges(RunReorganize, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Reorganizing/TypeDefaultOrderTests.cs b/CodeMaid.IntegrationTests/Reorganizing/TypeDefaultOrderTests.cs deleted file mode 100644 index f194b2982..000000000 --- a/CodeMaid.IntegrationTests/Reorganizing/TypeDefaultOrderTests.cs +++ /dev/null @@ -1,67 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Reorganizing; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Reorganizing -{ - [TestClass] - [DeploymentItem(@"Reorganizing\Data\TypeDefaultOrder.cs", "Data")] - [DeploymentItem(@"Reorganizing\Data\TypeDefaultOrder_Reorganized.cs", "Data")] - public class TypeDefaultOrderTests - { - #region Setup - - private static CodeReorganizationManager _codeReorganizationManager; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _codeReorganizationManager = CodeReorganizationManager.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_codeReorganizationManager); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\TypeDefaultOrder.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingTypeDefaultOrder_ReorganizesAsExpected() - { - TestOperations.ExecuteCommandAndVerifyResults(RunReorganize, _projectItem, @"Data\TypeDefaultOrder_Reorganized.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void ReorganizingTypeDefaultOrder_DoesNothingOnSecondPass() - { - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunReorganize, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunReorganize(Document document) - { - _codeReorganizationManager.Reorganize(document); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Sorting/Data/SortAtBottom.cs b/CodeMaid.IntegrationTests/Sorting/Data/SortAtBottom.cs deleted file mode 100644 index 8f729c1b9..000000000 --- a/CodeMaid.IntegrationTests/Sorting/Data/SortAtBottom.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Sorting.Data -{ - internal class SortAtBottom - { - } -} - -// This is a comment at the top of a file -// Followed by a second line which should come above it -// And a third line which should become the first -// Not to be confused with the fourth line that should become the third diff --git a/CodeMaid.IntegrationTests/Sorting/Data/SortAtBottom_Sorted.cs b/CodeMaid.IntegrationTests/Sorting/Data/SortAtBottom_Sorted.cs deleted file mode 100644 index 982619a2a..000000000 --- a/CodeMaid.IntegrationTests/Sorting/Data/SortAtBottom_Sorted.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Sorting.Data -{ - internal class SortAtBottom - { - } -} - -// And a third line which should become the first -// Followed by a second line which should come above it -// Not to be confused with the fourth line that should become the third -// This is a comment at the top of a file diff --git a/CodeMaid.IntegrationTests/Sorting/Data/SortAtTop.cs b/CodeMaid.IntegrationTests/Sorting/Data/SortAtTop.cs deleted file mode 100644 index 810745405..000000000 --- a/CodeMaid.IntegrationTests/Sorting/Data/SortAtTop.cs +++ /dev/null @@ -1,11 +0,0 @@ -// This is a comment at the top of a file -// Followed by a second line which should come above it -// And a third line which should become the first -// Not to be confused with the fourth line that should become the third - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Sorting.Data -{ - internal class SortAtTop - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Sorting/Data/SortAtTop_Sorted.cs b/CodeMaid.IntegrationTests/Sorting/Data/SortAtTop_Sorted.cs deleted file mode 100644 index d46c7be65..000000000 --- a/CodeMaid.IntegrationTests/Sorting/Data/SortAtTop_Sorted.cs +++ /dev/null @@ -1,11 +0,0 @@ -// And a third line which should become the first -// Followed by a second line which should come above it -// Not to be confused with the fourth line that should become the third -// This is a comment at the top of a file - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Sorting.Data -{ - internal class SortAtTop - { - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Sorting/Data/SortNoChange.cs b/CodeMaid.IntegrationTests/Sorting/Data/SortNoChange.cs deleted file mode 100644 index 01b6768ee..000000000 --- a/CodeMaid.IntegrationTests/Sorting/Data/SortNoChange.cs +++ /dev/null @@ -1,4 +0,0 @@ -// And a third line which should become the first -// Followed by a second line which should come above it -// Not to be confused with the fourth line that should become the third -// This is a comment at the top of a file diff --git a/CodeMaid.IntegrationTests/Sorting/SortAtBottomTests.cs b/CodeMaid.IntegrationTests/Sorting/SortAtBottomTests.cs deleted file mode 100644 index b26ab1dd4..000000000 --- a/CodeMaid.IntegrationTests/Sorting/SortAtBottomTests.cs +++ /dev/null @@ -1,64 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using System.ComponentModel.Design; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Sorting -{ - [TestClass] - [DeploymentItem(@"Sorting\Data\SortAtBottom.cs", "Data")] - [DeploymentItem(@"Sorting\Data\SortAtBottom_Sorted.cs", "Data")] - public class SortAtBottomTests - { - #region Setup - - private ProjectItem _projectItem; - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\SortAtBottom.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void SortAtBottom_FormatsAsExpected() - { - TestOperations.ExecuteCommandAndVerifyResults(RunSort, _projectItem, @"Data\SortAtBottom_Sorted.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void SortAtBottom_DoesNothingOnSecondPass() - { - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunSort, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunSort(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - textDocument.Selection.EndOfDocument(); - textDocument.Selection.LineUp(true, 4); - - var sortCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSortLines); - TestUtils.ExecuteCommand(sortCommand); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Sorting/SortAtTopTests.cs b/CodeMaid.IntegrationTests/Sorting/SortAtTopTests.cs deleted file mode 100644 index e1cdcb0ee..000000000 --- a/CodeMaid.IntegrationTests/Sorting/SortAtTopTests.cs +++ /dev/null @@ -1,64 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using System.ComponentModel.Design; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Sorting -{ - [TestClass] - [DeploymentItem(@"Sorting\Data\SortAtTop.cs", "Data")] - [DeploymentItem(@"Sorting\Data\SortAtTop_Sorted.cs", "Data")] - public class SortAtTopTests - { - #region Setup - - private ProjectItem _projectItem; - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\SortAtTop.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void SortAtTop_FormatsAsExpected() - { - TestOperations.ExecuteCommandAndVerifyResults(RunSort, _projectItem, @"Data\SortAtTop_Sorted.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void SortAtTop_DoesNothingOnSecondPass() - { - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunSort, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunSort(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - textDocument.Selection.StartOfDocument(); - textDocument.Selection.LineDown(true, 4); - - var sortCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSortLines); - TestUtils.ExecuteCommand(sortCommand); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Sorting/SortNoChangeTests.cs b/CodeMaid.IntegrationTests/Sorting/SortNoChangeTests.cs deleted file mode 100644 index e47acf28d..000000000 --- a/CodeMaid.IntegrationTests/Sorting/SortNoChangeTests.cs +++ /dev/null @@ -1,56 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using System.ComponentModel.Design; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Sorting -{ - [TestClass] - [DeploymentItem(@"Sorting\Data\SortNoChange.cs", "Data")] - [DeploymentItem(@"Sorting\Data\SortNoChange_Sorted.cs", "Data")] - public class SortNoChangeTests - { - #region Setup - - private ProjectItem _projectItem; - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\SortNoChange.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void SortNoChange_DoesNothingOnFirstPass() - { - TestOperations.ExecuteCommandAndVerifyNoChanges(RunSort, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunSort(Document document) - { - var textDocument = TestUtils.GetTextDocument(document); - textDocument.Selection.SelectAll(); - - var sortCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSortLines); - TestUtils.ExecuteCommand(sortCommand); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/ToolWindowTests.cs b/CodeMaid.IntegrationTests/ToolWindowTests.cs deleted file mode 100644 index 5f6e7460a..000000000 --- a/CodeMaid.IntegrationTests/ToolWindowTests.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using System; -using System.ComponentModel.Design; - -namespace SteveCadwallader.CodeMaid.IntegrationTests -{ - [TestClass] - public class ToolWindowTests - { - [TestMethod] - [HostType("VS IDE")] - public void ShowBuildProgressTest() - { - UIThreadInvoker.Invoke(new Action(() => - { - var buildProgressToolWindowCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidBuildProgressToolWindow); - TestUtils.ExecuteCommand(buildProgressToolWindowCommand); - - Assert.IsTrue(TestUtils.CanFindToolwindow(PackageGuids.GuidCodeMaidToolWindowBuildProgress)); - })); - } - - [TestMethod] - [HostType("VS IDE")] - public void ShowSpadeTest() - { - UIThreadInvoker.Invoke(new Action(() => - { - var spadeToolWindowCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeToolWindow); - TestUtils.ExecuteCommand(spadeToolWindowCommand); - - Assert.IsTrue(TestUtils.CanFindToolwindow(PackageGuids.GuidCodeMaidToolWindowSpade)); - })); - } - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/app.config b/CodeMaid.IntegrationTests/app.config deleted file mode 100644 index af636acd8..000000000 --- a/CodeMaid.IntegrationTests/app.config +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/packages.config b/CodeMaid.IntegrationTests/packages.config deleted file mode 100644 index c5a1104e7..000000000 --- a/CodeMaid.IntegrationTests/packages.config +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj b/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj index d418d35eb..9faa2cbb3 100644 --- a/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj +++ b/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj @@ -1,7 +1,5 @@  - - Debug AnyCPU @@ -44,35 +42,7 @@ false - - False - - - False - - - False - - - False - - - ..\packages\VS.QualityTools.UnitTestFramework.15.0.27323.2\lib\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll - - - ..\packages\Microsoft.VisualStudio.Threading.15.8.209\lib\net46\Microsoft.VisualStudio.Threading.dll - - - ..\packages\Microsoft.VisualStudio.Validation.15.3.58\lib\net45\Microsoft.VisualStudio.Validation.dll - - - ..\packages\NSubstitute.1.10.0.0\lib\net45\NSubstitute.dll - True - - - ..\packages\NUnit.3.13.1\lib\net45\nunit.framework.dll - @@ -108,11 +78,26 @@ Properties\CodeMaid.snk - - - + + 17.0.0 + + + 2.2.7 + + + 2.2.7 + + + 4.2.2 + + + 3.13.2 + + + 4.0.0 + @@ -134,15 +119,6 @@ - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - + \ No newline at end of file diff --git a/CodeMaid.VS2022/Properties/AssemblyInfo.cs b/CodeMaid.VS2022/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..402a256c3 --- /dev/null +++ b/CodeMaid.VS2022/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Reflection; + +[assembly: AssemblyTitle("SteveCadwallader.CodeMaid.VS2022")] \ No newline at end of file diff --git a/CodeMaid.VS2022/source.extension.cs b/CodeMaid.VS2022/source.extension.cs new file mode 100644 index 000000000..d0972c787 --- /dev/null +++ b/CodeMaid.VS2022/source.extension.cs @@ -0,0 +1,13 @@ +namespace SteveCadwallader.CodeMaid +{ + static class Vsix + { + public const string Id = "4c82e17d-927e-42d2-8460-b473ac7df316"; + public const string Name = "CodeMaid"; + public const string Description = "CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, R, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding."; + public const string Language = "en-US"; + public const string Version = "11.2"; + public const string Author = "Steve Cadwallader"; + public const string Tags = "build, code, c#, beautify, cleanup, cleaning, digging, reorganizing, formatting"; + } +} diff --git a/CodeMaid.VS2022/source.extension.en-US.resx b/CodeMaid.VS2022/source.extension.en-US.resx new file mode 100644 index 000000000..c0f9b16ef --- /dev/null +++ b/CodeMaid.VS2022/source.extension.en-US.resx @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + CodeMaid + + + CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, R, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding. + + + + source.extension.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/CodeMaid.VS2022/source.extension.ico b/CodeMaid.VS2022/source.extension.ico new file mode 100644 index 0000000000000000000000000000000000000000..a2b70637e743b5465a165dcb05fa57d1b871309a GIT binary patch literal 835 zcmV-J1HAkI0096203aX$0096P04)Om02TlM0EtjeM-2)Z3IG5A4M|8uQUCw|AOHXW zAP5Ek0047(dh`GQ00DDSM?wIu&K&6g000DMK}|sb0I`n?{9y$E000SaNLh0L01m?d z01m?e$8V@)0008QNkl?)ZH?Bp zN>-LJcaR}bV27ZCqjf9~f`^FRWQdorK$J0@Iu>q?2`c;3X1dwtY<}DGd!PM#(}XfS z^nPG`zrWvj-}n3ep67Xw;fRp}NCBh(Qh+@J#5cZiceq5pCb+9o7hpY`!P%QvdG!y- z70_T%BEPf48=?Tm4Ju%FmsfvAXJ;q6y1IDvD~0t9G(OPrswTi%EQZ@}U-Rnkkjv%V z?ahV$yWG_T*!iBrm8Ukrmqw)3YB4xC2(#IY;o)KGr&1|;JBPyoi^W1chR5T9(P)It zW`oP+LQ_){^~cA@sXs60&X<%gYp^ zmW71{jEs!%stTKc-EN1~YNbh)e2~Jvt-MPKJ4UI+vybus6?Uvz1WscpQO1fV`N7J2$wi2{0E9;kxrV zuYS+O#006^?IvXt2#3S;#;dEVn3|fR{`B-TshD$pM(%3&K;#Q9@nd)pi;Ih-KA(>? z6bd1oPLq#Dqm}-C6KLG;7@jbz>pqkFQ9dQ?WH2I;2(2&ME9?~IayiV*%+NB3iKSDx z=y=F0QGg$%hrfC^hG;@q*Td%h#}Dv)5|*b-U4WxN3LpiL0{rg*fS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + CodeMaid + + + CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, R, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding. + + + + source.extension.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/CodeMaid.VS2022/source.extension.vsixmanifest b/CodeMaid.VS2022/source.extension.vsixmanifest new file mode 100644 index 000000000..9011cecc2 --- /dev/null +++ b/CodeMaid.VS2022/source.extension.vsixmanifest @@ -0,0 +1,27 @@ + + + + + CodeMaid + CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, R, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding. + http://www.codemaid.net/ + LICENSE.txt + CodeMaid.png + CodeMaid_Large.png + build, code, c#, beautify, cleanup, cleaning, digging, reorganizing, formatting + + + + amd64 + + + + + + + + + + + + diff --git a/CodeMaid.VS2022/source.extension.zh-Hans.resx b/CodeMaid.VS2022/source.extension.zh-Hans.resx new file mode 100644 index 000000000..3f3b835c0 --- /dev/null +++ b/CodeMaid.VS2022/source.extension.zh-Hans.resx @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + CodeMaid + + + CodeMaid 是一个开源Visual Studio 扩展, 用于清理和简化我们的 C#、C++、F#、VB、PHP、PowerShell、R、JSON、XAML、XML、ASP、HTML、CSS、LESS、SCSS、JavaScript 和TypeScript编码。 + + + + source.extension.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/CodeMaid.sln b/CodeMaid.sln index c0232b9a9..7ec933dda 100644 --- a/CodeMaid.sln +++ b/CodeMaid.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.25928.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31729.503 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{69127706-88D9-4314-B801-4FB2E615B700}" ProjectSection(SolutionItems) = preProject @@ -11,7 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution CHANGELOG.md = CHANGELOG.md CONTRIBUTING.md = CONTRIBUTING.md GlobalAssemblyInfo.cs = GlobalAssemblyInfo.cs - IntegrationTests.testsettings = IntegrationTests.testsettings ISSUE_TEMPLATE.md = ISSUE_TEMPLATE.md LICENSE.txt = LICENSE.txt README.md = README.md @@ -19,11 +18,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeMaid", "CodeMaid\CodeMaid.csproj", "{19B1AB9E-4603-4A9C-9284-32AAE57FB7BC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeMaid.IntegrationTests", "CodeMaid.IntegrationTests\CodeMaid.IntegrationTests.csproj", "{756CCDA3-D5E9-44B8-8049-1317B1826776}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeMaid.UnitTests", "CodeMaid.UnitTests\CodeMaid.UnitTests.csproj", "{27C78B2A-18BC-4CE0-BCB1-DB4C30D805BE}" EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CodeMaidShared", "CodeMaidShared\CodeMaidShared.shproj", "{E94629D8-7803-4242-A0C6-3560005515E6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeMaid.VS2022", "CodeMaid.VS2022\CodeMaid.VS2022.csproj", "{6D3EDF86-D2F8-4779-8A95-052227ED56A9}" +EndProject Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + CodeMaidShared\CodeMaidShared.projitems*{19b1ab9e-4603-4a9c-9284-32aae57fb7bc}*SharedItemsImports = 4 + CodeMaidShared\CodeMaidShared.projitems*{6d3edf86-d2f8-4779-8a95-052227ed56a9}*SharedItemsImports = 4 + CodeMaidShared\CodeMaidShared.projitems*{e94629d8-7803-4242-a0c6-3560005515e6}*SharedItemsImports = 13 + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU @@ -33,18 +39,21 @@ Global {19B1AB9E-4603-4A9C-9284-32AAE57FB7BC}.Debug|Any CPU.Build.0 = Debug|Any CPU {19B1AB9E-4603-4A9C-9284-32AAE57FB7BC}.Release|Any CPU.ActiveCfg = Release|Any CPU {19B1AB9E-4603-4A9C-9284-32AAE57FB7BC}.Release|Any CPU.Build.0 = Release|Any CPU - {756CCDA3-D5E9-44B8-8049-1317B1826776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {756CCDA3-D5E9-44B8-8049-1317B1826776}.Debug|Any CPU.Build.0 = Debug|Any CPU - {756CCDA3-D5E9-44B8-8049-1317B1826776}.Release|Any CPU.ActiveCfg = Release|Any CPU - {756CCDA3-D5E9-44B8-8049-1317B1826776}.Release|Any CPU.Build.0 = Release|Any CPU {27C78B2A-18BC-4CE0-BCB1-DB4C30D805BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {27C78B2A-18BC-4CE0-BCB1-DB4C30D805BE}.Debug|Any CPU.Build.0 = Debug|Any CPU {27C78B2A-18BC-4CE0-BCB1-DB4C30D805BE}.Release|Any CPU.ActiveCfg = Release|Any CPU {27C78B2A-18BC-4CE0-BCB1-DB4C30D805BE}.Release|Any CPU.Build.0 = Release|Any CPU + {6D3EDF86-D2F8-4779-8A95-052227ED56A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6D3EDF86-D2F8-4779-8A95-052227ED56A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6D3EDF86-D2F8-4779-8A95-052227ED56A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6D3EDF86-D2F8-4779-8A95-052227ED56A9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {54B15E96-7E75-4C46-858D-E5DAC0343C58} + EndGlobalSection GlobalSection(TestCaseManagementSettings) = postSolution CategoryFile = CodeMaid.vsmdi EndGlobalSection diff --git a/CodeMaid/CodeMaid.csproj b/CodeMaid/CodeMaid.csproj index e2dacbbd9..8b156e102 100644 --- a/CodeMaid/CodeMaid.csproj +++ b/CodeMaid/CodeMaid.csproj @@ -1,6 +1,5 @@  - Debug @@ -55,139 +54,15 @@ False - - False - - - False - - - False - - - False - - - False - - - ..\packages\Microsoft.VisualStudio.ComponentModelHost.15.8.525\lib\net46\Microsoft.VisualStudio.ComponentModelHost.dll - - - ..\packages\Microsoft.VisualStudio.CoreUtility.15.8.525\lib\net46\Microsoft.VisualStudio.CoreUtility.dll - - - ..\packages\Microsoft.VisualStudio.Editor.15.8.525\lib\net46\Microsoft.VisualStudio.Editor.dll - - - ..\packages\Microsoft.VisualStudio.ImageCatalog.15.9.28307\lib\net45\Microsoft.VisualStudio.ImageCatalog.dll - - - ..\packages\Microsoft.VisualStudio.Imaging.15.9.28307\lib\net45\Microsoft.VisualStudio.Imaging.dll - - - ..\packages\Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.14.3.26930\lib\net20\Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll - True - - - ..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6071\lib\Microsoft.VisualStudio.OLE.Interop.dll - - - ..\packages\Microsoft.VisualStudio.Package.LanguageService.15.0.15.9.28307\lib\net45\Microsoft.VisualStudio.Package.LanguageService.15.0.dll - - - ..\packages\Microsoft.VisualStudio.Shell.15.0.15.9.28307\lib\net45\Microsoft.VisualStudio.Shell.15.0.dll - - - ..\packages\Microsoft.VisualStudio.Shell.Framework.15.9.28307\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6072\lib\net11\Microsoft.VisualStudio.Shell.Interop.dll - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30320\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61031\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.12.0.12.0.30111\lib\net20\Microsoft.VisualStudio.Shell.Interop.12.0.dll - True - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.14.3.26929\lib\net20\Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.dll - True - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.15.0.26929\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime.dll - True - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime.15.6.27413\lib\net20\Microsoft.VisualStudio.Shell.Interop.15.6.DesignTime.dll - True - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50728\lib\net11\Microsoft.VisualStudio.Shell.Interop.8.0.dll - - - ..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30730\lib\net11\Microsoft.VisualStudio.Shell.Interop.9.0.dll - - - ..\packages\Microsoft.VisualStudio.Text.Data.15.8.525\lib\net46\Microsoft.VisualStudio.Text.Data.dll - - - ..\packages\Microsoft.VisualStudio.Text.Logic.15.8.525\lib\net46\Microsoft.VisualStudio.Text.Logic.dll - - - ..\packages\Microsoft.VisualStudio.Text.UI.15.8.525\lib\net46\Microsoft.VisualStudio.Text.UI.dll - - - ..\packages\Microsoft.VisualStudio.Text.UI.Wpf.15.8.525\lib\net46\Microsoft.VisualStudio.Text.UI.Wpf.dll - - - ..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6071\lib\net11\Microsoft.VisualStudio.TextManager.Interop.dll - - - ..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50728\lib\net11\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - - - ..\packages\Microsoft.VisualStudio.Threading.15.8.209\lib\net46\Microsoft.VisualStudio.Threading.dll - - - ..\packages\Microsoft.VisualStudio.Utilities.15.9.28307\lib\net46\Microsoft.VisualStudio.Utilities.dll - - - ..\packages\Microsoft.VisualStudio.Validation.15.3.58\lib\net45\Microsoft.VisualStudio.Validation.dll - - - ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll - - - False - - - ..\packages\StreamJsonRpc.1.3.23\lib\net45\StreamJsonRpc.dll - - - ..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll - - - ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll - - - ..\packages\Expression.Blend.Sdk.1.0.2\lib\net45\System.Windows.Interactivity.dll - @@ -205,262 +80,10 @@ True CodeMaid.vsct - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Resources.resx - - - True - True - Settings.settings - - - Settings.settings - source.extension.vsixmanifest - - - - - - - - - - - - - - - - - - - - AboutWindow.xaml - - - - CleanupProgressWindow.xaml - - - - - - - - - - - - - - - - - - - - - - - OptionsWindow.xaml - - - - - - - - - - YesNoPromptWindow.xaml - - - - EditableTextBlock.xaml - - - - - - - - - - - - - - BuildProgressView.xaml - - - - - - - RadialProgressBar.xaml - - - - SpadeView.xaml - - - - - - - - - - - - - - - - Designer - @@ -688,180 +311,12 @@ - - Designer - - - PublicSettingsSingleFileGenerator - Settings.Designer.cs - VsixManifestGenerator source.extension.resx - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - Resources.resx - - - PublicResXFileCodeGenerator - Resources.Designer.cs - Designer - - - Resources.resx - true VSPackage.en-US.resources @@ -880,22 +335,31 @@ source.extension.vsixmanifest + + + 1.0.2 + + + 16.10.31321.278 + + + 16.11.35 + runtime; build; native; contentfiles; analyzers + all + + + 13.0.1 + + + 5.0.0 + + + 4.5.0 + + + - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - -