diff --git a/CHANGELOG.md b/CHANGELOG.md index 5567791ec..09c112c8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## vNext (11.3) +## vNext (12.1) 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/). @@ -12,6 +12,21 @@ These changes have not been released to the Visual Studio marketplace, but (if c These are the changes to each version that has been released to the Visual Studio marketplace. +## 12.0 + +**2021-11-07** + +- [x] 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)! + - [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! + +- [x] Fixes + - [x] [#800](https://github.com/codecadwallader/codemaid/pull/800) - Reorganizing: Fix dialog showing literal newline characters + + ## 11.2 **2021-01-02** 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. -

-} -
- -
-

Use another service to log in.

- @Html.Action("ExternalLoginsList", new { ReturnUrl = ViewBag.ReturnUrl }) -
- -@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 14ee762ea..9faa2cbb3 100644 --- a/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj +++ b/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj @@ -42,32 +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 - @@ -87,6 +62,7 @@ + @@ -102,11 +78,26 @@ Properties\CodeMaid.snk - - - + + 17.0.0 + + + 2.2.7 + + + 2.2.7 + + + 4.2.2 + + + 3.13.2 + + + 4.0.0 + @@ -128,13 +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}. - - - \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 text) + { + var headerLength = FileHeaderHelper.GetHeaderLength(language, text); + + Assert.IsTrue(headerLength > 0, $"Expecting value > 0, found {headerLength}"); + } + + [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 text) + { + var headerLength = FileHeaderHelper.GetHeaderLength(language, text); + + Assert.IsTrue(headerLength == 0, $"Expecting 0, found {headerLength}"); + } + + [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 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 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 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(text, tagStart, tagEnd, true); + + Assert.IsTrue(headerLength == expectedLength, $"Expecting {expectedLength}, found {headerLength}"); + } + + [TestCase("", "/*", "*/")] + [TestCase("some text", "/*", "*/")] + [TestCase("/* \r\n \r\n ", "/*", "*/")] + [TestCase("/* header */", "/*", "*>")] + [TestCase("*/ ", "/*", "*/")] + public void GetHeaderLengthMultiLineZero(string text, string tagStart, string tagEnd) + { + var headerLength = FileHeaderHelper.GetHeaderLength(text, tagStart, tagEnd, false); + + 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")] + [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 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(text, tag, true); + + 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 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// 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 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 nbLines = FileHeaderHelper.GetNbLinesToSkip(patternToFind, text, new List() { limit }); + + Assert.IsTrue(nbLines == expectedNbLines, $"Expecting {expectedNbLines}, found {expectedNbLines}"); + } + } +} \ No newline at end of file diff --git a/CodeMaid.UnitTests/packages.config b/CodeMaid.UnitTests/packages.config deleted file mode 100644 index 322163b24..000000000 --- a/CodeMaid.UnitTests/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/CodeMaid.VS2022/CodeMaid.VS2022.csproj b/CodeMaid.VS2022/CodeMaid.VS2022.csproj new file mode 100644 index 000000000..bd38845e9 --- /dev/null +++ b/CodeMaid.VS2022/CodeMaid.VS2022.csproj @@ -0,0 +1,752 @@ + + + + + Debug + AnyCPU + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + true + 2.0 + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {6D3EDF86-D2F8-4779-8A95-052227ED56A9} + Library + Properties + SteveCadwallader.CodeMaid + SteveCadwallader.CodeMaid.VS2022 + True + ..\CodeMaid.snk + v4.7.2 + en-US + true + true + true + true + true + false + Program + $(DevEnvDir)devenv.exe + /rootsuffix Exp + latest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + True + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + false + False + + + + + + + + + + + + + + + + + + + Properties\GlobalAssemblyInfo.cs + + + Properties\CodeMaid.snk + + + CodeMaid.cs + True + True + CodeMaid.vsct + + + + source.extension.vsixmanifest + + + + + Integration\Images\IDE\progressToolWindow.png + + + Integration\Images\IDE\spadeToolWindow.png + + + zh-Hans\extension.vsixlangpack + true + Always + + + source.extension.vsixmanifest + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Class.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Class_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Class_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Class_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Constant.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Constant_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Constant_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Constant_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Delegate.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Delegate_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Delegate_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Delegate_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Enum.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\EnumItem.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\EnumItem_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\EnumItem_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\EnumItem_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Enum_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Enum_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Enum_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Event.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Event_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Event_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Event_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Field.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Field_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Field_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Field_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Interface.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Interface_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Interface_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Interface_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Method.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\MethodConstructor.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\MethodConstructor_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\MethodConstructor_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\MethodConstructor_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\MethodDestructor.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\MethodDestructor_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\MethodDestructor_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\MethodDestructor_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Method_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Method_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Method_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Property.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Property_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Property_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Property_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Region.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Structure.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Structure_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Structure_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Dark\Structure_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Class.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Class_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Class_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Class_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Constant.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Constant_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Constant_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Constant_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Delegate.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Delegate_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Delegate_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Delegate_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Enum.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\EnumItem.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\EnumItem_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\EnumItem_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\EnumItem_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Enum_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Enum_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Enum_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Event.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Event_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Event_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Event_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Field.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Field_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Field_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Field_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Interface.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Interface_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Interface_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Interface_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Method.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\MethodConstructor.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\MethodConstructor_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\MethodConstructor_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\MethodConstructor_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\MethodDestructor.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\MethodDestructor_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\MethodDestructor_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\MethodDestructor_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Method_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Method_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Method_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Property.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Property_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Property_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Property_Protected.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Region.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Structure.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Structure_Friend.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Structure_Private.png + + + UI\ToolWindows\Spade\Images\VS2012_Light\Structure_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\EnumItem.png + + + UI\ToolWindows\Spade\Images\VS2010\EnumItem_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\EnumItem_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\EnumItem_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\Class.png + + + UI\ToolWindows\Spade\Images\VS2010\Class_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\Class_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\Class_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\Constant.png + + + UI\ToolWindows\Spade\Images\VS2010\Constant_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\Constant_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\Constant_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\Delegate.png + + + UI\ToolWindows\Spade\Images\VS2010\Delegate_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\Delegate_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\Delegate_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\Enum.png + + + UI\ToolWindows\Spade\Images\VS2010\Enum_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\Enum_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\Enum_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\Event.png + + + UI\ToolWindows\Spade\Images\VS2010\Event_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\Event_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\Event_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\Field.png + + + UI\ToolWindows\Spade\Images\VS2010\Field_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\Field_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\Field_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\Interface.png + + + UI\ToolWindows\Spade\Images\VS2010\Interface_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\Interface_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\Interface_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\Method.png + + + UI\ToolWindows\Spade\Images\VS2010\MethodConstructor.png + + + UI\ToolWindows\Spade\Images\VS2010\MethodConstructor_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\MethodConstructor_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\MethodConstructor_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\MethodDestructor.png + + + UI\ToolWindows\Spade\Images\VS2010\MethodDestructor_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\MethodDestructor_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\MethodDestructor_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\Method_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\Method_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\Method_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\Property.png + + + UI\ToolWindows\Spade\Images\VS2010\Property_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\Property_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\Property_Protected.png + + + UI\ToolWindows\Spade\Images\VS2010\Region.png + + + UI\ToolWindows\Spade\Images\VS2010\Structure.png + + + UI\ToolWindows\Spade\Images\VS2010\Structure_Friend.png + + + UI\ToolWindows\Spade\Images\VS2010\Structure_Private.png + + + UI\ToolWindows\Spade\Images\VS2010\Structure_Protected.png + + + UI\Themes\Images\CollapsedDark.png + + + UI\Themes\Images\ExpandedDark.png + + + UI\Themes\Images\ExpandedLight.png + + + UI\Themes\Images\CollapsedLight.png + + + LICENSE.txt + Always + true + + + CodeMaid.png + Always + true + + + CodeMaid.zh-Hans.vsct + Menus.ctmenu + CodeMaid.vsct + + + CodeMaid.en-US.vsct + Menus.ctmenu + CodeMaid.vsct + Designer + + + CodeMaid.imagemanifest + true + + + CodeMaid.vsct + Designer + CodeMaid.cs + VsctGenerator + + + CodeMaid_Large.png + Always + true + + + Integration\Images\about.png + + + Integration\Images\IDE\cleanup.bmp + + + Integration\Images\IDE\cleanupAll.bmp + + + Integration\Images\IDE\closeLocked.bmp + + + Integration\Images\IDE\collapse.bmp + + + Integration\Images\IDE\options.bmp + + + Integration\Images\IDE\find.bmp + + + Integration\Images\IDE\info.bmp + + + Integration\Images\IDE\join.bmp + + + Integration\Images\IDE\lock.bmp + + + Integration\Images\IDE\progress.bmp + + + Integration\Images\IDE\progressToolWindow.bmp + + + Integration\Images\IDE\refresh.bmp + + + Integration\Images\IDE\reorganize.bmp + + + Integration\Images\IDE\sortAlpha.bmp + + + Integration\Images\IDE\sortNumeric.bmp + + + Integration\Images\IDE\sortType.bmp + + + Integration\Images\IDE\spade.bmp + + + Integration\Images\IDE\spadeToolWindow.bmp + + + Integration\Images\IDE\switch.bmp + + + Integration\Images\IDE\unlock.bmp + + + Integration\Images\IDE\commentformat.bmp + + + Integration\Images\IDE\removeRegion.bmp + + + VsixManifestGenerator + source.extension.resx + + + + + true + VSPackage.en-US.resources + source.extension.vsixmanifest + + + True + True + source.extension.vsixmanifest + true + VSPackage + + + true + VSPackage.zh-Hans.resources + source.extension.vsixmanifest + + + + + 1.0.2 + + + 17.0.0-previews-2-31512-422 + + + 17.0.3177-preview3 + runtime; build; native; contentfiles; analyzers + all + + + 13.0.1 + + + 5.0.0 + + + 4.5.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..05e3ca53d --- /dev/null +++ b/CodeMaid.VS2022/source.extension.cs @@ -0,0 +1,13 @@ +namespace SteveCadwallader.CodeMaid +{ + internal 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 = "12.0"; + public const string Author = "Steve Cadwallader"; + public const string Tags = "build, code, c#, beautify, cleanup, cleaning, digging, reorganizing, formatting"; + } +} \ No newline at end of file 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 000000000..a2b70637e Binary files /dev/null and b/CodeMaid.VS2022/source.extension.ico differ diff --git a/CodeMaid.VS2022/source.extension.resx b/CodeMaid.VS2022/source.extension.resx new file mode 100644 index 000000000..c0f9b16ef --- /dev/null +++ b/CodeMaid.VS2022/source.extension.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.vsixmanifest b/CodeMaid.VS2022/source.extension.vsixmanifest new file mode 100644 index 000000000..f008846c3 --- /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 + + + + + + + + + + + + \ No newline at end of file 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 7d8a3a86c..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,259 +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 - @@ -685,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 @@ -877,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}. - - - - - - - - - - - "); + + case CodeLanguage.CSS: + return GetHeaderLength(text, "/*", "*/"); + + case CodeLanguage.PHP: + return GetHeaderLength(text, "//") + + GetHeaderLength(text, "#") + + GetHeaderLength(text, "/*", "*/"); + + case CodeLanguage.PowerShell: + return GetHeaderLength(text, "#") + + GetHeaderLength(text, "<#", "#>"); + + case CodeLanguage.R: + return GetHeaderLength(text, "#"); + + case CodeLanguage.FSharp: + return GetHeaderLength(text, "//") + + GetHeaderLength(text, "(*", "*)"); + + case CodeLanguage.VisualBasic: + return GetHeaderLength(text, "'"); + + case CodeLanguage.JSON: + case CodeLanguage.Unknown: + default: + return 0; + } + } + + 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); + } + + /// + /// Gets the number of lines to skip to pass occurrences of + /// + /// 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) + { + var max = GetLowestIndex(text, limits); + var potentialTextBlock = text.Substring(0, max); + var lastIndex = potentialTextBlock.LastIndexOf(startOfLine); + + if (lastIndex == -1) + { + return 0; + } + + var relevantTextBlock = potentialTextBlock.Substring(0, lastIndex); + + 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; + } + + result.Add(line); + } + + return result; + } + + /// + /// 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); + + 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) + private static int GetHeaderLength(string text, string commentSyntaxStart, string commentSyntaxEnd) + { + if (!text.TrimStart().StartsWith(commentSyntaxStart) || text.IndexOf(commentSyntaxEnd) == -1) + { + return 0; + } + + var lines = SplitLines(text); + var header = new List(); + + header.AddRange(GetEmptyLines(lines, 0)); + + 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 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 text.Split(separator, StringSplitOptions.None); + } + } +} \ No newline at end of file diff --git a/CodeMaid/Helpers/MemberTypeSetting.cs b/CodeMaidShared/Helpers/MemberTypeSetting.cs similarity index 100% rename from CodeMaid/Helpers/MemberTypeSetting.cs rename to CodeMaidShared/Helpers/MemberTypeSetting.cs diff --git a/CodeMaid/Helpers/MemberTypeSettingHelper.cs b/CodeMaidShared/Helpers/MemberTypeSettingHelper.cs similarity index 100% rename from CodeMaid/Helpers/MemberTypeSettingHelper.cs rename to CodeMaidShared/Helpers/MemberTypeSettingHelper.cs diff --git a/CodeMaid/Helpers/OutputWindowHelper.cs b/CodeMaidShared/Helpers/OutputWindowHelper.cs similarity index 100% rename from CodeMaid/Helpers/OutputWindowHelper.cs rename to CodeMaidShared/Helpers/OutputWindowHelper.cs diff --git a/CodeMaid/Helpers/ProjectItemExtensions.cs b/CodeMaidShared/Helpers/ProjectItemExtensions.cs similarity index 100% rename from CodeMaid/Helpers/ProjectItemExtensions.cs rename to CodeMaidShared/Helpers/ProjectItemExtensions.cs diff --git a/CodeMaid/Helpers/PropertyInfoHelper.cs b/CodeMaidShared/Helpers/PropertyInfoHelper.cs similarity index 100% rename from CodeMaid/Helpers/PropertyInfoHelper.cs rename to CodeMaidShared/Helpers/PropertyInfoHelper.cs diff --git a/CodeMaid/Helpers/RegexNullSafe.cs b/CodeMaidShared/Helpers/RegexNullSafe.cs similarity index 100% rename from CodeMaid/Helpers/RegexNullSafe.cs rename to CodeMaidShared/Helpers/RegexNullSafe.cs diff --git a/CodeMaid/Helpers/RegionHelper.cs b/CodeMaidShared/Helpers/RegionHelper.cs similarity index 100% rename from CodeMaid/Helpers/RegionHelper.cs rename to CodeMaidShared/Helpers/RegionHelper.cs diff --git a/CodeMaid/Helpers/SettingsContextHelper.cs b/CodeMaidShared/Helpers/SettingsContextHelper.cs similarity index 100% rename from CodeMaid/Helpers/SettingsContextHelper.cs rename to CodeMaidShared/Helpers/SettingsContextHelper.cs diff --git a/CodeMaid/Helpers/SettingsMonitor.cs b/CodeMaidShared/Helpers/SettingsMonitor.cs similarity index 100% rename from CodeMaid/Helpers/SettingsMonitor.cs rename to CodeMaidShared/Helpers/SettingsMonitor.cs diff --git a/CodeMaid/Helpers/SolutionHelper.cs b/CodeMaidShared/Helpers/SolutionHelper.cs similarity index 100% rename from CodeMaid/Helpers/SolutionHelper.cs rename to CodeMaidShared/Helpers/SolutionHelper.cs diff --git a/CodeMaid/Helpers/TextDocumentExtensions.cs b/CodeMaidShared/Helpers/TextDocumentExtensions.cs similarity index 100% rename from CodeMaid/Helpers/TextDocumentExtensions.cs rename to CodeMaidShared/Helpers/TextDocumentExtensions.cs diff --git a/CodeMaidShared/Helpers/TextDocumentHelper.cs b/CodeMaidShared/Helpers/TextDocumentHelper.cs new file mode 100644 index 000000000..0706f4f8f --- /dev/null +++ b/CodeMaidShared/Helpers/TextDocumentHelper.cs @@ -0,0 +1,483 @@ +using EnvDTE; +using Microsoft.VisualStudio.Editor; +using Microsoft.VisualStudio.Shell; +using Microsoft.VisualStudio.Shell.Interop; +using Microsoft.VisualStudio.Text; +using Microsoft.VisualStudio.Text.Operations; +using Microsoft.VisualStudio.TextManager.Interop; +using SteveCadwallader.CodeMaid.Model.CodeItems; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace SteveCadwallader.CodeMaid.Helpers +{ + /// + /// A static helper class for working with text documents. + /// + /// + /// + /// Note: All POSIXRegEx text replacements search against '\n' but insert/replace with + /// Environment.NewLine. This handles line endings correctly. + /// + internal static class TextDocumentHelper + { + #region Internal Constants + + /// + /// The common set of options to be used for find and replace patterns. + /// + internal const FindOptions StandardFindOptions = FindOptions.UseRegularExpressions; + + #endregion Internal Constants + + #region Internal Methods + + /// + /// Finds all matches of the specified pattern within the specified text document. + /// + /// The text document. + /// The pattern string. + /// The set of matches. + internal static IEnumerable FindMatches(TextDocument textDocument, string patternString) + { + var matches = new List(); + RunOnUIThread(() => + { + ThreadHelper.ThrowIfNotOnUIThread(); + + if (TryGetTextBufferAt(textDocument.Parent.FullName, out ITextBuffer textBuffer)) + { + IFinder finder = GetFinder(patternString, textBuffer); + var findMatches = finder.FindAll(); + foreach (var match in findMatches) + { + matches.Add(GetEditPointForSnapshotPosition(textDocument, textBuffer.CurrentSnapshot, match.Start)); + } + } + }); + + return matches; + } + + /// + /// Finds all matches of the specified pattern within the specified text selection. + /// + /// The text selection. + /// The pattern string. + /// The set of matches. + internal static IEnumerable FindMatches(TextSelection textSelection, string patternString) + { + var matches = new List(); + RunOnUIThread(() => + { + ThreadHelper.ThrowIfNotOnUIThread(); + if (TryGetTextBufferAt(textSelection.Parent.Parent.FullName, out ITextBuffer textBuffer)) + { + IFinder finder = GetFinder(patternString, textBuffer); + var findMatches = finder.FindAll(GetSnapshotSpanForTextSelection(textBuffer.CurrentSnapshot, textSelection)); + foreach (var match in findMatches) + { + matches.Add(GetEditPointForSnapshotPosition(textSelection.Parent, textBuffer.CurrentSnapshot, match.Start)); + } + } + }); + + return matches; + } + + /// + /// Finds the first match of the specified pattern within the specified text document, otherwise null. + /// + /// The text document. + /// The pattern string. + /// The first match, otherwise null. + internal static EditPoint FirstOrDefaultMatch(TextDocument textDocument, string patternString) + { + EditPoint result = null; + RunOnUIThread(() => + { + ThreadHelper.ThrowIfNotOnUIThread(); + + if (TryGetTextBufferAt(textDocument.Parent.FullName, out ITextBuffer textBuffer)) + { + IFinder finder = GetFinder(patternString, textBuffer); + if (finder.TryFind(out Span match)) + { + result = GetEditPointForSnapshotPosition(textDocument, textBuffer.CurrentSnapshot, match.Start); + } + } + }); + + return result; + } + + /// + /// Attempts to find next match starting with and if sucessful, + /// updates to point to the end position of the match. + /// + /// + /// + /// + /// True if successful, false if no match found. + internal static bool TryFindNextMatch(EditPoint startPoint, ref EditPoint endPoint, string patternString) + { + bool result = false; + EditPoint resultEndPoint = null; + + RunOnUIThread(() => + { + ThreadHelper.ThrowIfNotOnUIThread(); + + if (TryGetTextBufferAt(startPoint.Parent.Parent.FullName, out ITextBuffer textBuffer)) + { + IFinder finder = GetFinder(patternString, textBuffer); + + if (finder.TryFind(GetSnapshotPositionForTextPoint(textBuffer.CurrentSnapshot, startPoint), out Span match)) + { + resultEndPoint = GetEditPointForSnapshotPosition(startPoint.Parent, textBuffer.CurrentSnapshot, match.End); + result = true; + } + } + }); + + endPoint = resultEndPoint; + return result; + } + + /// + /// Gets the text between the specified start point and the first match. + /// + /// The start point. + /// The match string. + /// The matching text, otherwise null. + internal static string GetTextToFirstMatch(TextPoint startPoint, string matchString) + { + string result = null; + RunOnUIThread(() => + { + ThreadHelper.ThrowIfNotOnUIThread(); + + if (TryGetTextBufferAt(startPoint.Parent.Parent.FullName, out ITextBuffer textBuffer)) + { + IFinder finder = GetFinder(matchString, textBuffer); + if (finder.TryFind(out Span match)) + { + result = textBuffer.CurrentSnapshot.GetText(match); + } + } + }); + + return result; + } + + /// + /// Inserts a blank line before the specified point except where adjacent to a brace. + /// + /// The point. + internal static void InsertBlankLineBeforePoint(EditPoint point) + { + if (point.Line <= 1) return; + + point.LineUp(1); + point.StartOfLine(); + + string text = point.GetLine(); + if (RegexNullSafe.IsMatch(text, @"^\s*[^\s\{]")) // If it is not a scope boundary, insert newline. + { + point.EndOfLine(); + point.Insert(Environment.NewLine); + } + } + + /// + /// Inserts a blank line after the specified point except where adjacent to a brace. + /// + /// The point. + internal static void InsertBlankLineAfterPoint(EditPoint point) + { + if (point.AtEndOfDocument) return; + + point.LineDown(1); + point.StartOfLine(); + + string text = point.GetLine(); + if (RegexNullSafe.IsMatch(text, @"^\s*[^\s\}]")) + { + point.Insert(Environment.NewLine); + } + } + + /// + /// Attempts to move the cursor to the specified code item. + /// + /// The document. + /// The code item. + /// True if the whole element should be used for centering. + internal static void MoveToCodeItem(Document document, BaseCodeItem codeItem, bool centerOnWhole) + { + var textDocument = document.GetTextDocument(); + if (textDocument == null) return; + + try + { + object viewRangeEnd = null; + TextPoint navigatePoint = null; + + codeItem.RefreshCachedPositionAndName(); + textDocument.Selection.MoveToPoint(codeItem.StartPoint, false); + + if (centerOnWhole) + { + viewRangeEnd = codeItem.EndPoint; + } + + var codeItemElement = codeItem as BaseCodeItemElement; + if (codeItemElement != null) + { + navigatePoint = codeItemElement.CodeElement.GetStartPoint(vsCMPart.vsCMPartNavigate); + } + + textDocument.Selection.AnchorPoint.TryToShow(vsPaneShowHow.vsPaneShowCentered, viewRangeEnd); + + if (navigatePoint != null) + { + textDocument.Selection.MoveToPoint(navigatePoint, false); + } + else + { + textDocument.Selection.FindText(codeItem.Name, (int)vsFindOptions.vsFindOptionsMatchInHiddenText); + textDocument.Selection.MoveToPoint(textDocument.Selection.AnchorPoint, false); + } + } + catch (Exception) + { + // Move operation may fail if element is no longer available. + } + finally + { + // Always set focus within the code editor window. + document.Activate(); + } + } + + /// + /// Attempts to select the text of the specified code item. + /// + /// The document. + /// The code item. + internal static void SelectCodeItem(Document document, BaseCodeItem codeItem) + { + var textDocument = document.GetTextDocument(); + if (textDocument == null) return; + + try + { + codeItem.RefreshCachedPositionAndName(); + textDocument.Selection.MoveToPoint(codeItem.StartPoint, false); + textDocument.Selection.MoveToPoint(codeItem.EndPoint, true); + + textDocument.Selection.SwapAnchor(); + } + catch (Exception) + { + // Select operation may fail if element is no longer available. + } + finally + { + // Always set focus within the code editor window. + document.Activate(); + } + } + + /// + /// Substitutes all occurrences in the specified text document of the specified pattern + /// string with the specified replacement string. + /// + /// The text document. + /// The pattern string. + /// The replacement string. + internal static void SubstituteAllStringMatches(TextDocument textDocument, string patternString, string replacementString) + { + RunOnUIThread(() => + { + ThreadHelper.ThrowIfNotOnUIThread(); + + if (TryGetTextBufferAt(textDocument.Parent.FullName, out ITextBuffer textBuffer)) + { + IFinder finder = GetFinder(patternString, replacementString, textBuffer); + ReplaceAll(textBuffer, finder.FindForReplaceAll()); + } + }); + } + + /// + /// Substitutes all occurrences in the specified text selection of the specified pattern + /// string with the specified replacement string. + /// + /// The text selection. + /// The pattern string. + /// The replacement string. + internal static void SubstituteAllStringMatches(TextSelection textSelection, string patternString, string replacementString) + { + RunOnUIThread(() => + { + ThreadHelper.ThrowIfNotOnUIThread(); + + if (TryGetTextBufferAt(textSelection.Parent.Parent.FullName, out ITextBuffer textBuffer)) + { + IFinder finder = GetFinder(patternString, replacementString, textBuffer); + ReplaceAll(textBuffer, finder.FindForReplaceAll(GetSnapshotSpanForTextSelection(textBuffer.CurrentSnapshot, textSelection))); + } + }); + } + + /// + /// Substitutes all occurrences between the specified start and end points of the specified + /// pattern string with the specified replacement string. + /// + /// The start point. + /// The end point. + /// The pattern string. + /// The replacement string. + internal static void SubstituteAllStringMatches(EditPoint startPoint, EditPoint endPoint, string patternString, string replacementString) + { + RunOnUIThread(() => + { + ThreadHelper.ThrowIfNotOnUIThread(); + + if (TryGetTextBufferAt(startPoint.Parent.Parent.FullName, out ITextBuffer textBuffer)) + { + IFinder finder = GetFinder(patternString, replacementString, textBuffer); + ReplaceAll(textBuffer, finder.FindForReplaceAll(GetSnapshotSpanForExtent(textBuffer.CurrentSnapshot, startPoint, endPoint))); + } + }); + } + + #endregion Internal Methods + + #region Private Methods + + private static EditPoint GetEditPointForSnapshotPosition(TextDocument textDocument, ITextSnapshot textSnapshot, int position) + { + ThreadHelper.ThrowIfNotOnUIThread(); + + var editPoint = textDocument.CreateEditPoint(); + var textSnapshotLine = textSnapshot.GetLineFromPosition(position); + editPoint.MoveToLineAndOffset(textSnapshotLine.LineNumber + 1, position - textSnapshotLine.Start.Position + 1); + return editPoint; + } + + private static IFinder GetFinder(string findWhat, ITextBuffer textBuffer) + { + var findService = CodeMaidPackage.Instance.ComponentModel.GetService(); + var finderFactory = findService.CreateFinderFactory(findWhat, StandardFindOptions); + return finderFactory.Create(textBuffer.CurrentSnapshot); + } + + private static IFinder GetFinder(string findWhat, string replaceWith, ITextBuffer textBuffer) + { + var findService = CodeMaidPackage.Instance.ComponentModel.GetService(); + var finderFactory = findService.CreateFinderFactory(findWhat, replaceWith, StandardFindOptions); + return finderFactory.Create(textBuffer.CurrentSnapshot); + } + + private static Span GetSnapshotSpanForTextSelection(ITextSnapshot textSnapshot, TextSelection selection) + { + ThreadHelper.ThrowIfNotOnUIThread(); + + var startPosition = GetSnapshotPositionForTextPoint(textSnapshot, selection.AnchorPoint); + var endPosition = GetSnapshotPositionForTextPoint(textSnapshot, selection.ActivePoint); + + if (startPosition <= endPosition) + { + return new Span(startPosition, endPosition - startPosition); + } + else + { + return new Span(endPosition, startPosition - endPosition); + } + } + + private static int GetSnapshotPositionForTextPoint(ITextSnapshot textSnapshot, TextPoint textPoint) + { + ThreadHelper.ThrowIfNotOnUIThread(); + + var textSnapshotLine = textSnapshot.GetLineFromLineNumber(textPoint.Line - 1); + return textSnapshotLine.Start.Position + textPoint.LineCharOffset; + } + + private static Span GetSnapshotSpanForExtent(ITextSnapshot textSnapshot, EditPoint startPoint, EditPoint endPoint) + { + ThreadHelper.ThrowIfNotOnUIThread(); + + var startPosition = GetSnapshotPositionForTextPoint(textSnapshot, startPoint); + var endPosition = GetSnapshotPositionForTextPoint(textSnapshot, endPoint); + + if (startPosition <= endPosition) + { + return new Span(startPosition, endPosition - startPosition); + } + else + { + return new Span(endPosition, startPosition - endPosition); + } + } + + private static void ReplaceAll(ITextBuffer textBuffer, IEnumerable replacements) + { + if (replacements.Any()) + { + using (var edit = textBuffer.CreateEdit()) + { + foreach (var match in replacements) + { + edit.Replace(match.Match, match.Replace); + } + + edit.Apply(); + } + } + } + + private static void RunOnUIThread(Action action) + { + CodeMaidPackage.Instance.JoinableTaskFactory.Run(async () => + { + await CodeMaidPackage.Instance.JoinableTaskFactory.SwitchToMainThreadAsync(); + action(); + }); + } + + private static bool TryGetTextBufferAt(string filePath, out ITextBuffer textBuffer) + { + IVsWindowFrame windowFrame; + if (VsShellUtilities.IsDocumentOpen( + CodeMaidPackage.Instance, + filePath, + Guid.Empty, + out var _, + out var _, + out windowFrame)) + { + IVsTextView view = VsShellUtilities.GetTextView(windowFrame); + IVsTextLines lines; + if (view.GetBuffer(out lines) == 0) + { + var buffer = lines as IVsTextBuffer; + if (buffer != null) + { + var editorAdapterFactoryService = CodeMaidPackage.Instance.ComponentModel.GetService(); + textBuffer = editorAdapterFactoryService.GetDataBuffer(buffer); + return true; + } + } + } + + textBuffer = null; + return false; + } + + #endregion Private Methods + } +} \ No newline at end of file diff --git a/CodeMaid/Helpers/TypeFormatHelper.cs b/CodeMaidShared/Helpers/TypeFormatHelper.cs similarity index 100% rename from CodeMaid/Helpers/TypeFormatHelper.cs rename to CodeMaidShared/Helpers/TypeFormatHelper.cs diff --git a/CodeMaid/Helpers/UIHierarchyHelper.cs b/CodeMaidShared/Helpers/UIHierarchyHelper.cs similarity index 100% rename from CodeMaid/Helpers/UIHierarchyHelper.cs rename to CodeMaidShared/Helpers/UIHierarchyHelper.cs diff --git a/CodeMaid/Helpers/UndoTransactionHelper.cs b/CodeMaidShared/Helpers/UndoTransactionHelper.cs similarity index 100% rename from CodeMaid/Helpers/UndoTransactionHelper.cs rename to CodeMaidShared/Helpers/UndoTransactionHelper.cs diff --git a/CodeMaid/Integration/Commands/AboutCommand.cs b/CodeMaidShared/Integration/Commands/AboutCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/AboutCommand.cs rename to CodeMaidShared/Integration/Commands/AboutCommand.cs diff --git a/CodeMaid/Integration/Commands/BaseCommand.cs b/CodeMaidShared/Integration/Commands/BaseCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/BaseCommand.cs rename to CodeMaidShared/Integration/Commands/BaseCommand.cs diff --git a/CodeMaid/Integration/Commands/BuildProgressToolWindowCommand.cs b/CodeMaidShared/Integration/Commands/BuildProgressToolWindowCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/BuildProgressToolWindowCommand.cs rename to CodeMaidShared/Integration/Commands/BuildProgressToolWindowCommand.cs diff --git a/CodeMaid/Integration/Commands/CleanupActiveCodeCommand.cs b/CodeMaidShared/Integration/Commands/CleanupActiveCodeCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/CleanupActiveCodeCommand.cs rename to CodeMaidShared/Integration/Commands/CleanupActiveCodeCommand.cs diff --git a/CodeMaid/Integration/Commands/CleanupAllCodeCommand.cs b/CodeMaidShared/Integration/Commands/CleanupAllCodeCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/CleanupAllCodeCommand.cs rename to CodeMaidShared/Integration/Commands/CleanupAllCodeCommand.cs diff --git a/CodeMaid/Integration/Commands/CleanupOpenCodeCommand.cs b/CodeMaidShared/Integration/Commands/CleanupOpenCodeCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/CleanupOpenCodeCommand.cs rename to CodeMaidShared/Integration/Commands/CleanupOpenCodeCommand.cs diff --git a/CodeMaid/Integration/Commands/CleanupSelectedCodeCommand.cs b/CodeMaidShared/Integration/Commands/CleanupSelectedCodeCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/CleanupSelectedCodeCommand.cs rename to CodeMaidShared/Integration/Commands/CleanupSelectedCodeCommand.cs diff --git a/CodeMaid/Integration/Commands/CloseAllReadOnlyCommand.cs b/CodeMaidShared/Integration/Commands/CloseAllReadOnlyCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/CloseAllReadOnlyCommand.cs rename to CodeMaidShared/Integration/Commands/CloseAllReadOnlyCommand.cs diff --git a/CodeMaid/Integration/Commands/CollapseAllSolutionExplorerCommand.cs b/CodeMaidShared/Integration/Commands/CollapseAllSolutionExplorerCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/CollapseAllSolutionExplorerCommand.cs rename to CodeMaidShared/Integration/Commands/CollapseAllSolutionExplorerCommand.cs diff --git a/CodeMaid/Integration/Commands/CollapseSelectedSolutionExplorerCommand.cs b/CodeMaidShared/Integration/Commands/CollapseSelectedSolutionExplorerCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/CollapseSelectedSolutionExplorerCommand.cs rename to CodeMaidShared/Integration/Commands/CollapseSelectedSolutionExplorerCommand.cs diff --git a/CodeMaid/Integration/Commands/CommentFormatCommand.cs b/CodeMaidShared/Integration/Commands/CommentFormatCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/CommentFormatCommand.cs rename to CodeMaidShared/Integration/Commands/CommentFormatCommand.cs diff --git a/CodeMaid/Integration/Commands/FindInSolutionExplorerCommand.cs b/CodeMaidShared/Integration/Commands/FindInSolutionExplorerCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/FindInSolutionExplorerCommand.cs rename to CodeMaidShared/Integration/Commands/FindInSolutionExplorerCommand.cs diff --git a/CodeMaid/Integration/Commands/JoinLinesCommand.cs b/CodeMaidShared/Integration/Commands/JoinLinesCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/JoinLinesCommand.cs rename to CodeMaidShared/Integration/Commands/JoinLinesCommand.cs diff --git a/CodeMaid/Integration/Commands/OptionsCommand.cs b/CodeMaidShared/Integration/Commands/OptionsCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/OptionsCommand.cs rename to CodeMaidShared/Integration/Commands/OptionsCommand.cs diff --git a/CodeMaid/Integration/Commands/ReadOnlyToggleCommand.cs b/CodeMaidShared/Integration/Commands/ReadOnlyToggleCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/ReadOnlyToggleCommand.cs rename to CodeMaidShared/Integration/Commands/ReadOnlyToggleCommand.cs diff --git a/CodeMaid/Integration/Commands/RemoveRegionCommand.cs b/CodeMaidShared/Integration/Commands/RemoveRegionCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/RemoveRegionCommand.cs rename to CodeMaidShared/Integration/Commands/RemoveRegionCommand.cs diff --git a/CodeMaid/Integration/Commands/ReorganizeActiveCodeCommand.cs b/CodeMaidShared/Integration/Commands/ReorganizeActiveCodeCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/ReorganizeActiveCodeCommand.cs rename to CodeMaidShared/Integration/Commands/ReorganizeActiveCodeCommand.cs diff --git a/CodeMaid/Integration/Commands/SettingCleanupOnSaveCommand.cs b/CodeMaidShared/Integration/Commands/SettingCleanupOnSaveCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SettingCleanupOnSaveCommand.cs rename to CodeMaidShared/Integration/Commands/SettingCleanupOnSaveCommand.cs diff --git a/CodeMaid/Integration/Commands/SortLinesCommand.cs b/CodeMaidShared/Integration/Commands/SortLinesCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SortLinesCommand.cs rename to CodeMaidShared/Integration/Commands/SortLinesCommand.cs diff --git a/CodeMaid/Integration/Commands/SpadeContextDeleteCommand.cs b/CodeMaidShared/Integration/Commands/SpadeContextDeleteCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SpadeContextDeleteCommand.cs rename to CodeMaidShared/Integration/Commands/SpadeContextDeleteCommand.cs diff --git a/CodeMaid/Integration/Commands/SpadeContextFindReferencesCommand.cs b/CodeMaidShared/Integration/Commands/SpadeContextFindReferencesCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SpadeContextFindReferencesCommand.cs rename to CodeMaidShared/Integration/Commands/SpadeContextFindReferencesCommand.cs diff --git a/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs b/CodeMaidShared/Integration/Commands/SpadeContextInsertRegionCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs rename to CodeMaidShared/Integration/Commands/SpadeContextInsertRegionCommand.cs diff --git a/CodeMaid/Integration/Commands/SpadeContextRemoveRegionCommand.cs b/CodeMaidShared/Integration/Commands/SpadeContextRemoveRegionCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SpadeContextRemoveRegionCommand.cs rename to CodeMaidShared/Integration/Commands/SpadeContextRemoveRegionCommand.cs diff --git a/CodeMaid/Integration/Commands/SpadeOptionsCommand.cs b/CodeMaidShared/Integration/Commands/SpadeOptionsCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SpadeOptionsCommand.cs rename to CodeMaidShared/Integration/Commands/SpadeOptionsCommand.cs diff --git a/CodeMaid/Integration/Commands/SpadeRefreshCommand.cs b/CodeMaidShared/Integration/Commands/SpadeRefreshCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SpadeRefreshCommand.cs rename to CodeMaidShared/Integration/Commands/SpadeRefreshCommand.cs diff --git a/CodeMaid/Integration/Commands/SpadeSearchCommand.cs b/CodeMaidShared/Integration/Commands/SpadeSearchCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SpadeSearchCommand.cs rename to CodeMaidShared/Integration/Commands/SpadeSearchCommand.cs diff --git a/CodeMaid/Integration/Commands/SpadeSortOrderAlphaCommand.cs b/CodeMaidShared/Integration/Commands/SpadeSortOrderAlphaCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SpadeSortOrderAlphaCommand.cs rename to CodeMaidShared/Integration/Commands/SpadeSortOrderAlphaCommand.cs diff --git a/CodeMaid/Integration/Commands/SpadeSortOrderFileCommand.cs b/CodeMaidShared/Integration/Commands/SpadeSortOrderFileCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SpadeSortOrderFileCommand.cs rename to CodeMaidShared/Integration/Commands/SpadeSortOrderFileCommand.cs diff --git a/CodeMaid/Integration/Commands/SpadeSortOrderTypeCommand.cs b/CodeMaidShared/Integration/Commands/SpadeSortOrderTypeCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SpadeSortOrderTypeCommand.cs rename to CodeMaidShared/Integration/Commands/SpadeSortOrderTypeCommand.cs diff --git a/CodeMaid/Integration/Commands/SpadeToolWindowCommand.cs b/CodeMaidShared/Integration/Commands/SpadeToolWindowCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SpadeToolWindowCommand.cs rename to CodeMaidShared/Integration/Commands/SpadeToolWindowCommand.cs diff --git a/CodeMaid/Integration/Commands/SwitchFileCommand.cs b/CodeMaidShared/Integration/Commands/SwitchFileCommand.cs similarity index 100% rename from CodeMaid/Integration/Commands/SwitchFileCommand.cs rename to CodeMaidShared/Integration/Commands/SwitchFileCommand.cs diff --git a/CodeMaid/Integration/Events/BaseEventListener.cs b/CodeMaidShared/Integration/Events/BaseEventListener.cs similarity index 100% rename from CodeMaid/Integration/Events/BaseEventListener.cs rename to CodeMaidShared/Integration/Events/BaseEventListener.cs diff --git a/CodeMaid/Integration/Events/BuildProgressEventListener.cs b/CodeMaidShared/Integration/Events/BuildProgressEventListener.cs similarity index 100% rename from CodeMaid/Integration/Events/BuildProgressEventListener.cs rename to CodeMaidShared/Integration/Events/BuildProgressEventListener.cs diff --git a/CodeMaid/Integration/Events/DocumentEventListener.cs b/CodeMaidShared/Integration/Events/DocumentEventListener.cs similarity index 100% rename from CodeMaid/Integration/Events/DocumentEventListener.cs rename to CodeMaidShared/Integration/Events/DocumentEventListener.cs diff --git a/CodeMaid/Integration/Events/RunningDocumentTableEventListener.cs b/CodeMaidShared/Integration/Events/RunningDocumentTableEventListener.cs similarity index 100% rename from CodeMaid/Integration/Events/RunningDocumentTableEventListener.cs rename to CodeMaidShared/Integration/Events/RunningDocumentTableEventListener.cs diff --git a/CodeMaid/Integration/Events/SolutionEventListener.cs b/CodeMaidShared/Integration/Events/SolutionEventListener.cs similarity index 100% rename from CodeMaid/Integration/Events/SolutionEventListener.cs rename to CodeMaidShared/Integration/Events/SolutionEventListener.cs diff --git a/CodeMaid/Integration/Events/TextEditorEventListener.cs b/CodeMaidShared/Integration/Events/TextEditorEventListener.cs similarity index 100% rename from CodeMaid/Integration/Events/TextEditorEventListener.cs rename to CodeMaidShared/Integration/Events/TextEditorEventListener.cs diff --git a/CodeMaid/Integration/Events/WindowEventListener.cs b/CodeMaidShared/Integration/Events/WindowEventListener.cs similarity index 100% rename from CodeMaid/Integration/Events/WindowEventListener.cs rename to CodeMaidShared/Integration/Events/WindowEventListener.cs diff --git a/CodeMaid/Integration/ISwitchableFeature.cs b/CodeMaidShared/Integration/ISwitchableFeature.cs similarity index 100% rename from CodeMaid/Integration/ISwitchableFeature.cs rename to CodeMaidShared/Integration/ISwitchableFeature.cs diff --git a/CodeMaid/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs b/CodeMaidShared/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs similarity index 91% rename from CodeMaid/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs rename to CodeMaidShared/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs index ecca71644..4f9f4b54c 100644 --- a/CodeMaid/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs +++ b/CodeMaidShared/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/Logic/Cleaning/CodeCleanupManager.cs b/CodeMaidShared/Logic/Cleaning/CodeCleanupManager.cs similarity index 100% rename from CodeMaid/Logic/Cleaning/CodeCleanupManager.cs rename to CodeMaidShared/Logic/Cleaning/CodeCleanupManager.cs diff --git a/CodeMaidShared/Logic/Cleaning/FileHeaderLogic.cs b/CodeMaidShared/Logic/Cleaning/FileHeaderLogic.cs new file mode 100644 index 000000000..eed68ebd3 --- /dev/null +++ b/CodeMaidShared/Logic/Cleaning/FileHeaderLogic.cs @@ -0,0 +1,255 @@ +using EnvDTE; +using SteveCadwallader.CodeMaid.Helpers; +using SteveCadwallader.CodeMaid.Properties; +using SteveCadwallader.CodeMaid.UI.Enumerations; +using System; +using System.Collections.Generic; +using System.ComponentModel; + +namespace SteveCadwallader.CodeMaid.Logic.Cleaning +{ + /// + /// A class for encapsulating the logic of file header updates. + /// + internal class FileHeaderLogic + { + #region Fields + + private readonly CodeMaidPackage _package; + + private const int HeaderMaxNbLines = 60; + + #endregion Fields + + #region Constructors + + /// + /// The singleton instance of the class. + /// + private static FileHeaderLogic _instance; + + /// + /// Gets an instance of the class. + /// + /// The hosting package. + /// An instance of the class. + internal static FileHeaderLogic GetInstance(CodeMaidPackage package) + { + return _instance ?? (_instance = new FileHeaderLogic(package)); + } + + /// + /// Initializes a new instance of the class. + /// + /// The hosting package. + private FileHeaderLogic(CodeMaidPackage package) + { + _package = package; + } + + #endregion Constructors + + #region Methods + + /// + /// Updates the file header for the specified text document. + /// + /// The text document to update. + internal void UpdateFileHeader(TextDocument textDocument) + { + var settingsFileHeader = FileHeaderHelper.GetFileHeaderFromSettings(textDocument); + if (string.IsNullOrWhiteSpace(settingsFileHeader)) + { + return; + } + + if (!settingsFileHeader.EndsWith(Environment.NewLine)) + { + settingsFileHeader += Environment.NewLine; + } + + switch ((HeaderUpdateMode)Settings.Default.Cleaning_UpdateFileHeader_HeaderUpdateMode) + { + case HeaderUpdateMode.Insert: + InsertFileHeader(textDocument, settingsFileHeader); + break; + + 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); + } + } + + /// + /// Reads the first lines of a document + /// + /// The document to read + /// A string representing the first lines of the document + private string ReadTextBlock(TextDocument textDocument) + { + Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(); + + 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) + { + 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 headerBlockStart = textDocument.StartPoint.CreateEditPoint(); + var currentHeaderLength = GetHeaderLength(textDocument, false); + + headerBlockStart.ReplaceText(currentHeaderLength, settingsFileHeader, (int)vsEPReplaceTextOptions.vsEPReplaceTextKeepMarkers); + } + + #endregion Methods + } +} \ No newline at end of file diff --git a/CodeMaid/Logic/Cleaning/InsertBlankLinePaddingLogic.cs b/CodeMaidShared/Logic/Cleaning/InsertBlankLinePaddingLogic.cs similarity index 100% rename from CodeMaid/Logic/Cleaning/InsertBlankLinePaddingLogic.cs rename to CodeMaidShared/Logic/Cleaning/InsertBlankLinePaddingLogic.cs diff --git a/CodeMaid/Logic/Cleaning/InsertExplicitAccessModifierLogic.cs b/CodeMaidShared/Logic/Cleaning/InsertExplicitAccessModifierLogic.cs similarity index 100% rename from CodeMaid/Logic/Cleaning/InsertExplicitAccessModifierLogic.cs rename to CodeMaidShared/Logic/Cleaning/InsertExplicitAccessModifierLogic.cs diff --git a/CodeMaid/Logic/Cleaning/InsertWhitespaceLogic.cs b/CodeMaidShared/Logic/Cleaning/InsertWhitespaceLogic.cs similarity index 100% rename from CodeMaid/Logic/Cleaning/InsertWhitespaceLogic.cs rename to CodeMaidShared/Logic/Cleaning/InsertWhitespaceLogic.cs diff --git a/CodeMaid/Logic/Cleaning/RemoveRegionLogic.cs b/CodeMaidShared/Logic/Cleaning/RemoveRegionLogic.cs similarity index 100% rename from CodeMaid/Logic/Cleaning/RemoveRegionLogic.cs rename to CodeMaidShared/Logic/Cleaning/RemoveRegionLogic.cs diff --git a/CodeMaid/Logic/Cleaning/RemoveWhitespaceLogic.cs b/CodeMaidShared/Logic/Cleaning/RemoveWhitespaceLogic.cs similarity index 100% rename from CodeMaid/Logic/Cleaning/RemoveWhitespaceLogic.cs rename to CodeMaidShared/Logic/Cleaning/RemoveWhitespaceLogic.cs diff --git a/CodeMaid/Logic/Cleaning/UpdateLogic.cs b/CodeMaidShared/Logic/Cleaning/UpdateLogic.cs similarity index 98% rename from CodeMaid/Logic/Cleaning/UpdateLogic.cs rename to CodeMaidShared/Logic/Cleaning/UpdateLogic.cs index fd6801fab..a4651b080 100644 --- a/CodeMaid/Logic/Cleaning/UpdateLogic.cs +++ b/CodeMaidShared/Logic/Cleaning/UpdateLogic.cs @@ -66,12 +66,11 @@ internal void UpdateEndRegionDirectives(TextDocument textDocument) var regionStack = new Stack(); EditPoint cursor = textDocument.StartPoint.CreateEditPoint(); - TextRanges subGroupMatches = null; // Not used - required for FindPattern. const string pattern = @"^[ \t]*#"; // Keep pushing cursor forwards (note ref cursor parameter) until finished. while (cursor != null && - cursor.FindPattern(pattern, TextDocumentHelper.StandardFindOptions, ref cursor, ref subGroupMatches)) + TextDocumentHelper.TryFindNextMatch(startPoint: cursor, endPoint: ref cursor, pattern)) { // Create a pointer to capture the text for this line. EditPoint eolCursor = cursor.CreateEditPoint(); diff --git a/CodeMaid/Logic/Cleaning/UsingStatementCleanupLogic.cs b/CodeMaidShared/Logic/Cleaning/UsingStatementCleanupLogic.cs similarity index 93% rename from CodeMaid/Logic/Cleaning/UsingStatementCleanupLogic.cs rename to CodeMaidShared/Logic/Cleaning/UsingStatementCleanupLogic.cs index f2c0503a1..f83dfd305 100644 --- a/CodeMaid/Logic/Cleaning/UsingStatementCleanupLogic.cs +++ b/CodeMaidShared/Logic/Cleaning/UsingStatementCleanupLogic.cs @@ -77,14 +77,7 @@ public void RemoveAndSortUsingStatements(TextDocument textDocument) .Where(usingStatement => TextDocumentHelper.FirstOrDefaultMatch(textDocument, string.Format(patternFormat, usingStatement)) != null) .ToList(); - if (_package.IDEVersion >= 15) - { - _commandHelper.ExecuteCommand(textDocument, "EditorContextMenus.CodeWindow.RemoveAndSort"); - } - else - { - _commandHelper.ExecuteCommand(textDocument, "Edit.RemoveUnusedUsings"); - } + _commandHelper.ExecuteCommand(textDocument, "EditorContextMenus.CodeWindow.RemoveAndSort"); // Ignore any using statements that are still referenced usingStatementsToReinsert = usingStatementsToReinsert diff --git a/CodeMaid/Logic/Digging/OutliningSynchronizationManager.cs b/CodeMaidShared/Logic/Digging/OutliningSynchronizationManager.cs similarity index 100% rename from CodeMaid/Logic/Digging/OutliningSynchronizationManager.cs rename to CodeMaidShared/Logic/Digging/OutliningSynchronizationManager.cs diff --git a/CodeMaid/Logic/Formatting/CommentFormatLogic.cs b/CodeMaidShared/Logic/Formatting/CommentFormatLogic.cs similarity index 100% rename from CodeMaid/Logic/Formatting/CommentFormatLogic.cs rename to CodeMaidShared/Logic/Formatting/CommentFormatLogic.cs diff --git a/CodeMaid/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs b/CodeMaidShared/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs similarity index 99% rename from CodeMaid/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs rename to CodeMaidShared/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs index d8cf7c1e3..7cb53f57b 100644 --- a/CodeMaid/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs +++ b/CodeMaidShared/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/Logic/Reorganizing/CodeReorganizationManager.cs b/CodeMaidShared/Logic/Reorganizing/CodeReorganizationManager.cs similarity index 100% rename from CodeMaid/Logic/Reorganizing/CodeReorganizationManager.cs rename to CodeMaidShared/Logic/Reorganizing/CodeReorganizationManager.cs diff --git a/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs b/CodeMaidShared/Logic/Reorganizing/GenerateRegionLogic.cs similarity index 99% rename from CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs rename to CodeMaidShared/Logic/Reorganizing/GenerateRegionLogic.cs index ae4698e12..3da5e7c92 100644 --- a/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs +++ b/CodeMaidShared/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/Logic/Reorganizing/RegionComparerByName.cs b/CodeMaidShared/Logic/Reorganizing/RegionComparerByName.cs similarity index 100% rename from CodeMaid/Logic/Reorganizing/RegionComparerByName.cs rename to CodeMaidShared/Logic/Reorganizing/RegionComparerByName.cs diff --git a/CodeMaid/Model/CodeItems/BaseCodeItem.cs b/CodeMaidShared/Model/CodeItems/BaseCodeItem.cs similarity index 100% rename from CodeMaid/Model/CodeItems/BaseCodeItem.cs rename to CodeMaidShared/Model/CodeItems/BaseCodeItem.cs diff --git a/CodeMaid/Model/CodeItems/BaseCodeItemElement.cs b/CodeMaidShared/Model/CodeItems/BaseCodeItemElement.cs similarity index 100% rename from CodeMaid/Model/CodeItems/BaseCodeItemElement.cs rename to CodeMaidShared/Model/CodeItems/BaseCodeItemElement.cs diff --git a/CodeMaid/Model/CodeItems/BaseCodeItemElementParent.cs b/CodeMaidShared/Model/CodeItems/BaseCodeItemElementParent.cs similarity index 100% rename from CodeMaid/Model/CodeItems/BaseCodeItemElementParent.cs rename to CodeMaidShared/Model/CodeItems/BaseCodeItemElementParent.cs diff --git a/CodeMaid/Model/CodeItems/CodeItemClass.cs b/CodeMaidShared/Model/CodeItems/CodeItemClass.cs similarity index 100% rename from CodeMaid/Model/CodeItems/CodeItemClass.cs rename to CodeMaidShared/Model/CodeItems/CodeItemClass.cs diff --git a/CodeMaid/Model/CodeItems/CodeItemDelegate.cs b/CodeMaidShared/Model/CodeItems/CodeItemDelegate.cs similarity index 100% rename from CodeMaid/Model/CodeItems/CodeItemDelegate.cs rename to CodeMaidShared/Model/CodeItems/CodeItemDelegate.cs diff --git a/CodeMaid/Model/CodeItems/CodeItemEnum.cs b/CodeMaidShared/Model/CodeItems/CodeItemEnum.cs similarity index 100% rename from CodeMaid/Model/CodeItems/CodeItemEnum.cs rename to CodeMaidShared/Model/CodeItems/CodeItemEnum.cs diff --git a/CodeMaid/Model/CodeItems/CodeItemEvent.cs b/CodeMaidShared/Model/CodeItems/CodeItemEvent.cs similarity index 100% rename from CodeMaid/Model/CodeItems/CodeItemEvent.cs rename to CodeMaidShared/Model/CodeItems/CodeItemEvent.cs diff --git a/CodeMaid/Model/CodeItems/CodeItemField.cs b/CodeMaidShared/Model/CodeItems/CodeItemField.cs similarity index 100% rename from CodeMaid/Model/CodeItems/CodeItemField.cs rename to CodeMaidShared/Model/CodeItems/CodeItemField.cs diff --git a/CodeMaid/Model/CodeItems/CodeItemInterface.cs b/CodeMaidShared/Model/CodeItems/CodeItemInterface.cs similarity index 100% rename from CodeMaid/Model/CodeItems/CodeItemInterface.cs rename to CodeMaidShared/Model/CodeItems/CodeItemInterface.cs diff --git a/CodeMaid/Model/CodeItems/CodeItemMethod.cs b/CodeMaidShared/Model/CodeItems/CodeItemMethod.cs similarity index 100% rename from CodeMaid/Model/CodeItems/CodeItemMethod.cs rename to CodeMaidShared/Model/CodeItems/CodeItemMethod.cs diff --git a/CodeMaid/Model/CodeItems/CodeItemNamespace.cs b/CodeMaidShared/Model/CodeItems/CodeItemNamespace.cs similarity index 100% rename from CodeMaid/Model/CodeItems/CodeItemNamespace.cs rename to CodeMaidShared/Model/CodeItems/CodeItemNamespace.cs diff --git a/CodeMaid/Model/CodeItems/CodeItemProperty.cs b/CodeMaidShared/Model/CodeItems/CodeItemProperty.cs similarity index 100% rename from CodeMaid/Model/CodeItems/CodeItemProperty.cs rename to CodeMaidShared/Model/CodeItems/CodeItemProperty.cs diff --git a/CodeMaid/Model/CodeItems/CodeItemRegion.cs b/CodeMaidShared/Model/CodeItems/CodeItemRegion.cs similarity index 100% rename from CodeMaid/Model/CodeItems/CodeItemRegion.cs rename to CodeMaidShared/Model/CodeItems/CodeItemRegion.cs diff --git a/CodeMaid/Model/CodeItems/CodeItemStruct.cs b/CodeMaidShared/Model/CodeItems/CodeItemStruct.cs similarity index 100% rename from CodeMaid/Model/CodeItems/CodeItemStruct.cs rename to CodeMaidShared/Model/CodeItems/CodeItemStruct.cs diff --git a/CodeMaid/Model/CodeItems/CodeItemUsingStatement.cs b/CodeMaidShared/Model/CodeItems/CodeItemUsingStatement.cs similarity index 100% rename from CodeMaid/Model/CodeItems/CodeItemUsingStatement.cs rename to CodeMaidShared/Model/CodeItems/CodeItemUsingStatement.cs diff --git a/CodeMaid/Model/CodeItems/FactoryCodeItems.cs b/CodeMaidShared/Model/CodeItems/FactoryCodeItems.cs similarity index 100% rename from CodeMaid/Model/CodeItems/FactoryCodeItems.cs rename to CodeMaidShared/Model/CodeItems/FactoryCodeItems.cs diff --git a/CodeMaid/Model/CodeItems/ICodeItem.cs b/CodeMaidShared/Model/CodeItems/ICodeItem.cs similarity index 100% rename from CodeMaid/Model/CodeItems/ICodeItem.cs rename to CodeMaidShared/Model/CodeItems/ICodeItem.cs diff --git a/CodeMaid/Model/CodeItems/ICodeItemComplexity.cs b/CodeMaidShared/Model/CodeItems/ICodeItemComplexity.cs similarity index 100% rename from CodeMaid/Model/CodeItems/ICodeItemComplexity.cs rename to CodeMaidShared/Model/CodeItems/ICodeItemComplexity.cs diff --git a/CodeMaid/Model/CodeItems/ICodeItemParameters.cs b/CodeMaidShared/Model/CodeItems/ICodeItemParameters.cs similarity index 100% rename from CodeMaid/Model/CodeItems/ICodeItemParameters.cs rename to CodeMaidShared/Model/CodeItems/ICodeItemParameters.cs diff --git a/CodeMaid/Model/CodeItems/ICodeItemParent.cs b/CodeMaidShared/Model/CodeItems/ICodeItemParent.cs similarity index 100% rename from CodeMaid/Model/CodeItems/ICodeItemParent.cs rename to CodeMaidShared/Model/CodeItems/ICodeItemParent.cs diff --git a/CodeMaid/Model/CodeItems/IInterfaceItem.cs b/CodeMaidShared/Model/CodeItems/IInterfaceItem.cs similarity index 100% rename from CodeMaid/Model/CodeItems/IInterfaceItem.cs rename to CodeMaidShared/Model/CodeItems/IInterfaceItem.cs diff --git a/CodeMaid/Model/CodeItems/KindCodeItem.cs b/CodeMaidShared/Model/CodeItems/KindCodeItem.cs similarity index 100% rename from CodeMaid/Model/CodeItems/KindCodeItem.cs rename to CodeMaidShared/Model/CodeItems/KindCodeItem.cs diff --git a/CodeMaid/Model/CodeItems/SetCodeItems.cs b/CodeMaidShared/Model/CodeItems/SetCodeItems.cs similarity index 100% rename from CodeMaid/Model/CodeItems/SetCodeItems.cs rename to CodeMaidShared/Model/CodeItems/SetCodeItems.cs diff --git a/CodeMaid/Model/CodeItems/SnapshotCodeItems.cs b/CodeMaidShared/Model/CodeItems/SnapshotCodeItems.cs similarity index 100% rename from CodeMaid/Model/CodeItems/SnapshotCodeItems.cs rename to CodeMaidShared/Model/CodeItems/SnapshotCodeItems.cs diff --git a/CodeMaid/Model/CodeModel.cs b/CodeMaidShared/Model/CodeModel.cs similarity index 100% rename from CodeMaid/Model/CodeModel.cs rename to CodeMaidShared/Model/CodeModel.cs diff --git a/CodeMaid/Model/CodeModelBuilder.cs b/CodeMaidShared/Model/CodeModelBuilder.cs similarity index 100% rename from CodeMaid/Model/CodeModelBuilder.cs rename to CodeMaidShared/Model/CodeModelBuilder.cs diff --git a/CodeMaid/Model/CodeModelCache.cs b/CodeMaidShared/Model/CodeModelCache.cs similarity index 100% rename from CodeMaid/Model/CodeModelCache.cs rename to CodeMaidShared/Model/CodeModelCache.cs diff --git a/CodeMaid/Model/CodeModelHelper.cs b/CodeMaidShared/Model/CodeModelHelper.cs similarity index 100% rename from CodeMaid/Model/CodeModelHelper.cs rename to CodeMaidShared/Model/CodeModelHelper.cs diff --git a/CodeMaid/Model/CodeModelManager.cs b/CodeMaidShared/Model/CodeModelManager.cs similarity index 100% rename from CodeMaid/Model/CodeModelManager.cs rename to CodeMaidShared/Model/CodeModelManager.cs diff --git a/CodeMaid/Model/CodeTree/CodeSortOrder.cs b/CodeMaidShared/Model/CodeTree/CodeSortOrder.cs similarity index 100% rename from CodeMaid/Model/CodeTree/CodeSortOrder.cs rename to CodeMaidShared/Model/CodeTree/CodeSortOrder.cs diff --git a/CodeMaid/Model/CodeTree/CodeTreeBuilder.cs b/CodeMaidShared/Model/CodeTree/CodeTreeBuilder.cs similarity index 100% rename from CodeMaid/Model/CodeTree/CodeTreeBuilder.cs rename to CodeMaidShared/Model/CodeTree/CodeTreeBuilder.cs diff --git a/CodeMaid/Model/CodeTree/CodeTreeBuilderAsync.cs b/CodeMaidShared/Model/CodeTree/CodeTreeBuilderAsync.cs similarity index 100% rename from CodeMaid/Model/CodeTree/CodeTreeBuilderAsync.cs rename to CodeMaidShared/Model/CodeTree/CodeTreeBuilderAsync.cs diff --git a/CodeMaid/Model/CodeTree/CodeTreeRequest.cs b/CodeMaidShared/Model/CodeTree/CodeTreeRequest.cs similarity index 100% rename from CodeMaid/Model/CodeTree/CodeTreeRequest.cs rename to CodeMaidShared/Model/CodeTree/CodeTreeRequest.cs diff --git a/CodeMaid/Model/Comments/CodeComment.cs b/CodeMaidShared/Model/Comments/CodeComment.cs similarity index 100% rename from CodeMaid/Model/Comments/CodeComment.cs rename to CodeMaidShared/Model/Comments/CodeComment.cs diff --git a/CodeMaid/Model/Comments/CommentFormatter.cs b/CodeMaidShared/Model/Comments/CommentFormatter.cs similarity index 100% rename from CodeMaid/Model/Comments/CommentFormatter.cs rename to CodeMaidShared/Model/Comments/CommentFormatter.cs diff --git a/CodeMaid/Model/Comments/CommentLine.cs b/CodeMaidShared/Model/Comments/CommentLine.cs similarity index 100% rename from CodeMaid/Model/Comments/CommentLine.cs rename to CodeMaidShared/Model/Comments/CommentLine.cs diff --git a/CodeMaid/Model/Comments/CommentLineXml.cs b/CodeMaidShared/Model/Comments/CommentLineXml.cs similarity index 100% rename from CodeMaid/Model/Comments/CommentLineXml.cs rename to CodeMaidShared/Model/Comments/CommentLineXml.cs diff --git a/CodeMaid/Model/Comments/CommentMatch.cs b/CodeMaidShared/Model/Comments/CommentMatch.cs similarity index 100% rename from CodeMaid/Model/Comments/CommentMatch.cs rename to CodeMaidShared/Model/Comments/CommentMatch.cs diff --git a/CodeMaid/Model/Comments/ICommentLine.cs b/CodeMaidShared/Model/Comments/ICommentLine.cs similarity index 100% rename from CodeMaid/Model/Comments/ICommentLine.cs rename to CodeMaidShared/Model/Comments/ICommentLine.cs diff --git a/CodeMaid/Model/Comments/Options/CommentOptions.cs b/CodeMaidShared/Model/Comments/Options/CommentOptions.cs similarity index 100% rename from CodeMaid/Model/Comments/Options/CommentOptions.cs rename to CodeMaidShared/Model/Comments/Options/CommentOptions.cs diff --git a/CodeMaid/Model/Comments/Options/FormatterOptions.cs b/CodeMaidShared/Model/Comments/Options/FormatterOptions.cs similarity index 100% rename from CodeMaid/Model/Comments/Options/FormatterOptions.cs rename to CodeMaidShared/Model/Comments/Options/FormatterOptions.cs diff --git a/CodeMaid/Model/Comments/Options/FormatterOptionsXml.cs b/CodeMaidShared/Model/Comments/Options/FormatterOptionsXml.cs similarity index 100% rename from CodeMaid/Model/Comments/Options/FormatterOptionsXml.cs rename to CodeMaidShared/Model/Comments/Options/FormatterOptionsXml.cs diff --git a/CodeMaid/Model/Comments/Options/FormatterOptionsXmlTag.cs b/CodeMaidShared/Model/Comments/Options/FormatterOptionsXmlTag.cs similarity index 100% rename from CodeMaid/Model/Comments/Options/FormatterOptionsXmlTag.cs rename to CodeMaidShared/Model/Comments/Options/FormatterOptionsXmlTag.cs diff --git a/CodeMaid/Model/Comments/Options/IXmlTagOptions.cs b/CodeMaidShared/Model/Comments/Options/IXmlTagOptions.cs similarity index 100% rename from CodeMaid/Model/Comments/Options/IXmlTagOptions.cs rename to CodeMaidShared/Model/Comments/Options/IXmlTagOptions.cs diff --git a/CodeMaid/Model/Comments/Options/XmlTagCase.cs b/CodeMaidShared/Model/Comments/Options/XmlTagCase.cs similarity index 100% rename from CodeMaid/Model/Comments/Options/XmlTagCase.cs rename to CodeMaidShared/Model/Comments/Options/XmlTagCase.cs diff --git a/CodeMaid/Model/Comments/Options/XmlTagNewLine.cs b/CodeMaidShared/Model/Comments/Options/XmlTagNewLine.cs similarity index 100% rename from CodeMaid/Model/Comments/Options/XmlTagNewLine.cs rename to CodeMaidShared/Model/Comments/Options/XmlTagNewLine.cs diff --git a/CodeMaid/Model/Comments/Options/XmlTagOptions.cs b/CodeMaidShared/Model/Comments/Options/XmlTagOptions.cs similarity index 100% rename from CodeMaid/Model/Comments/Options/XmlTagOptions.cs rename to CodeMaidShared/Model/Comments/Options/XmlTagOptions.cs diff --git a/CodeMaid/Properties/Resources.Designer.cs b/CodeMaidShared/Properties/Resources.Designer.cs similarity index 98% rename from CodeMaid/Properties/Resources.Designer.cs rename to CodeMaidShared/Properties/Resources.Designer.cs index bd352aa9f..42072a352 100644 --- a/CodeMaid/Properties/Resources.Designer.cs +++ b/CodeMaidShared/Properties/Resources.Designer.cs @@ -925,12 +925,14 @@ public static string ConfigFilesConfigConfigAllFiles { } /// - /// 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); } } @@ -1510,6 +1512,15 @@ public static string None { } } + /// + /// 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?. /// @@ -1699,6 +1710,15 @@ public static string RegularExpressionsThatMatchPathNamesToExcludeExResxOrLib { } } + /// + /// 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/CodeMaidShared/Properties/Resources.en-US.resx similarity index 97% rename from CodeMaid/Properties/Resources.en-US.resx rename to CodeMaidShared/Properties/Resources.en-US.resx index b16740e2d..07ac49de2 100644 --- a/CodeMaid/Properties/Resources.en-US.resx +++ b/CodeMaidShared/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. @@ -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 @@ -924,4 +926,10 @@ 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\\ ) + + + Only for methods + \ No newline at end of file diff --git a/CodeMaid/Properties/Resources.resx b/CodeMaidShared/Properties/Resources.resx similarity index 98% rename from CodeMaid/Properties/Resources.resx rename to CodeMaidShared/Properties/Resources.resx index b842ce6d5..07ac49de2 100644 --- a/CodeMaid/Properties/Resources.resx +++ b/CodeMaidShared/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 @@ -924,4 +926,10 @@ 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\\ ) + + + Only for methods + \ No newline at end of file diff --git a/CodeMaid/Properties/Resources.zh-Hans.resx b/CodeMaidShared/Properties/Resources.zh-Hans.resx similarity index 98% rename from CodeMaid/Properties/Resources.zh-Hans.resx rename to CodeMaidShared/Properties/Resources.zh-Hans.resx index 02593c30f..c1b416796 100644 --- a/CodeMaid/Properties/Resources.zh-Hans.resx +++ b/CodeMaidShared/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. @@ -405,8 +405,8 @@ 配置文件 (*.config)|*.config|所有文件 (*.*)|*.* - - {0} 包含当前整理不支持的预处理器条件 (例如 #if、#pragma)。 \n 是否仍要整理 (危险)? + + {0} 包含当前整理不支持的预处理器条件 (例如 #if、#pragma)。 是否仍要整理 (危险)? 深色 @@ -924,4 +924,7 @@ 您有挂起的更改。 是否要在继续之前保存它们? + + Only for methods (TBT) + \ No newline at end of file diff --git a/CodeMaid/Properties/Settings.Designer.cs b/CodeMaidShared/Properties/Settings.Designer.cs similarity index 97% rename from CodeMaid/Properties/Settings.Designer.cs rename to CodeMaidShared/Properties/Settings.Designer.cs index d6ba7fecc..da4dd0cd9 100644 --- a/CodeMaid/Properties/Settings.Designer.cs +++ b/CodeMaidShared/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()))); @@ -2258,5 +2258,53 @@ public bool Cleaning_InsertBlankLinePaddingAfterFieldsSingleLine { 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; + } + } + + [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()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int Cleaning_UpdateFileHeader_HeaderUpdateMode { + get { + return ((int)(this["Cleaning_UpdateFileHeader_HeaderUpdateMode"])); + } + set { + 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.cs b/CodeMaidShared/Properties/Settings.cs similarity index 100% rename from CodeMaid/Properties/Settings.cs rename to CodeMaidShared/Properties/Settings.cs diff --git a/CodeMaid/Properties/Settings.settings b/CodeMaidShared/Properties/Settings.settings similarity index 97% rename from CodeMaid/Properties/Settings.settings rename to CodeMaidShared/Properties/Settings.settings index fcc61368d..cf5af9aa1 100644 --- a/CodeMaid/Properties/Settings.settings +++ b/CodeMaidShared/Properties/Settings.settings @@ -564,5 +564,17 @@ False + + + + + + + + + + + False + \ No newline at end of file diff --git a/CodeMaid/UI/Bindable.cs b/CodeMaidShared/UI/Bindable.cs similarity index 100% rename from CodeMaid/UI/Bindable.cs rename to CodeMaidShared/UI/Bindable.cs diff --git a/CodeMaid/UI/Converters/BooleanInverseConverter.cs b/CodeMaidShared/UI/Converters/BooleanInverseConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/BooleanInverseConverter.cs rename to CodeMaidShared/UI/Converters/BooleanInverseConverter.cs diff --git a/CodeMaid/UI/Converters/BooleanToVisibilityConverter.cs b/CodeMaidShared/UI/Converters/BooleanToVisibilityConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/BooleanToVisibilityConverter.cs rename to CodeMaidShared/UI/Converters/BooleanToVisibilityConverter.cs diff --git a/CodeMaid/UI/Converters/CodeItemParentHighestComplexityConverter.cs b/CodeMaidShared/UI/Converters/CodeItemParentHighestComplexityConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/CodeItemParentHighestComplexityConverter.cs rename to CodeMaidShared/UI/Converters/CodeItemParentHighestComplexityConverter.cs diff --git a/CodeMaid/UI/Converters/CodeItemParentMemberCountConverter.cs b/CodeMaidShared/UI/Converters/CodeItemParentMemberCountConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/CodeItemParentMemberCountConverter.cs rename to CodeMaidShared/UI/Converters/CodeItemParentMemberCountConverter.cs diff --git a/CodeMaid/UI/Converters/CodeItemToImageConverter.cs b/CodeMaidShared/UI/Converters/CodeItemToImageConverter.cs similarity index 97% rename from CodeMaid/UI/Converters/CodeItemToImageConverter.cs rename to CodeMaidShared/UI/Converters/CodeItemToImageConverter.cs index 8b8d03e03..7ab8f80b1 100644 --- a/CodeMaid/UI/Converters/CodeItemToImageConverter.cs +++ b/CodeMaidShared/UI/Converters/CodeItemToImageConverter.cs @@ -83,7 +83,7 @@ private string BuildImageURIString(BaseCodeItem codeItem) if (typeComponent == null) return null; - string uriString = $"/SteveCadwallader.CodeMaid;component/UI/ToolWindows/Spade/Images/{ImagePath}/{typeComponent}{accessComponent}.png"; + string uriString = $"/UI/ToolWindows/Spade/Images/{ImagePath}/{typeComponent}{accessComponent}.png"; return uriString; } diff --git a/CodeMaid/UI/Converters/CodeItemToMetadataStringConverter.cs b/CodeMaidShared/UI/Converters/CodeItemToMetadataStringConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/CodeItemToMetadataStringConverter.cs rename to CodeMaidShared/UI/Converters/CodeItemToMetadataStringConverter.cs diff --git a/CodeMaid/UI/Converters/DocCommentToStringConverter.cs b/CodeMaidShared/UI/Converters/DocCommentToStringConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/DocCommentToStringConverter.cs rename to CodeMaidShared/UI/Converters/DocCommentToStringConverter.cs diff --git a/CodeMaid/UI/Converters/EnumDescriptionConverter.cs b/CodeMaidShared/UI/Converters/EnumDescriptionConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/EnumDescriptionConverter.cs rename to CodeMaidShared/UI/Converters/EnumDescriptionConverter.cs diff --git a/CodeMaid/UI/Converters/EnumToBooleanConverter.cs b/CodeMaidShared/UI/Converters/EnumToBooleanConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/EnumToBooleanConverter.cs rename to CodeMaidShared/UI/Converters/EnumToBooleanConverter.cs diff --git a/CodeMaid/UI/Converters/IntToThicknessConverter.cs b/CodeMaidShared/UI/Converters/IntToThicknessConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/IntToThicknessConverter.cs rename to CodeMaidShared/UI/Converters/IntToThicknessConverter.cs diff --git a/CodeMaid/UI/Converters/IsGreaterThanOrEqualToConverter.cs b/CodeMaidShared/UI/Converters/IsGreaterThanOrEqualToConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/IsGreaterThanOrEqualToConverter.cs rename to CodeMaidShared/UI/Converters/IsGreaterThanOrEqualToConverter.cs diff --git a/CodeMaid/UI/Converters/NameParametersToTextBlockConverter.cs b/CodeMaidShared/UI/Converters/NameParametersToTextBlockConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/NameParametersToTextBlockConverter.cs rename to CodeMaidShared/UI/Converters/NameParametersToTextBlockConverter.cs diff --git a/CodeMaid/UI/Converters/NullToBooleanConverter.cs b/CodeMaidShared/UI/Converters/NullToBooleanConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/NullToBooleanConverter.cs rename to CodeMaidShared/UI/Converters/NullToBooleanConverter.cs diff --git a/CodeMaid/UI/Converters/PropertyInfoDescriptionConverter.cs b/CodeMaidShared/UI/Converters/PropertyInfoDescriptionConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/PropertyInfoDescriptionConverter.cs rename to CodeMaidShared/UI/Converters/PropertyInfoDescriptionConverter.cs diff --git a/CodeMaid/UI/Converters/StringReplaceConverter.cs b/CodeMaidShared/UI/Converters/StringReplaceConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/StringReplaceConverter.cs rename to CodeMaidShared/UI/Converters/StringReplaceConverter.cs diff --git a/CodeMaid/UI/Converters/TypeStringConverter.cs b/CodeMaidShared/UI/Converters/TypeStringConverter.cs similarity index 100% rename from CodeMaid/UI/Converters/TypeStringConverter.cs rename to CodeMaidShared/UI/Converters/TypeStringConverter.cs diff --git a/CodeMaid/UI/DelegateCommand.cs b/CodeMaidShared/UI/DelegateCommand.cs similarity index 100% rename from CodeMaid/UI/DelegateCommand.cs rename to CodeMaidShared/UI/DelegateCommand.cs diff --git a/CodeMaid/UI/DependencyObjectExtensions.cs b/CodeMaidShared/UI/DependencyObjectExtensions.cs similarity index 100% rename from CodeMaid/UI/DependencyObjectExtensions.cs rename to CodeMaidShared/UI/DependencyObjectExtensions.cs diff --git a/CodeMaid/UI/Dialogs/About/AboutWindow.xaml b/CodeMaidShared/UI/Dialogs/About/AboutWindow.xaml similarity index 95% rename from CodeMaid/UI/Dialogs/About/AboutWindow.xaml rename to CodeMaidShared/UI/Dialogs/About/AboutWindow.xaml index 52846417b..642d65b43 100644 --- a/CodeMaid/UI/Dialogs/About/AboutWindow.xaml +++ b/CodeMaidShared/UI/Dialogs/About/AboutWindow.xaml @@ -7,12 +7,12 @@ WindowStartupLocation="CenterScreen" WindowStyle="None" KeyDown="OnKeyDown" MouseLeftButtonDown="OnMouseLeftButtonDown"> - + - +