From c5b5cc3273ea361726acb672a91a4ef331798c45 Mon Sep 17 00:00:00 2001 From: DaveTryon <45672944+DaveTryon@users.noreply.github.com> Date: Thu, 9 Apr 2020 08:49:13 -0700 Subject: [PATCH] Remove hardcoded calls to System.Diagnostics.Debugger.Break (#350) --- src/Core/Misc/ExtensionMethods.cs | 8 -------- src/Desktop/UIAutomation/DesktopElement.cs | 4 ---- src/RuleSelection/RuleRunner.cs | 5 ----- src/Rules/Conditions/Condition.cs | 2 ++ src/RulesTest/MonsterTest.cs | 1 - 5 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/Core/Misc/ExtensionMethods.cs b/src/Core/Misc/ExtensionMethods.cs index 1a637200e..17130c753 100644 --- a/src/Core/Misc/ExtensionMethods.cs +++ b/src/Core/Misc/ExtensionMethods.cs @@ -418,14 +418,6 @@ public static ScanStatus GetAggregatedScanStatus(this IEnumerable ts { return ScanStatus.Uncertain; } - else if (HasTestResults(tss, ScanStatus.NoResult)) - { - // it means that there was no rule executed or - if (System.Diagnostics.Debugger.IsAttached) - { - System.Diagnostics.Debugger.Break(); - } - } return ScanStatus.Pass; } diff --git a/src/Desktop/UIAutomation/DesktopElement.cs b/src/Desktop/UIAutomation/DesktopElement.cs index 274c720c0..36d5f2ecd 100644 --- a/src/Desktop/UIAutomation/DesktopElement.cs +++ b/src/Desktop/UIAutomation/DesktopElement.cs @@ -151,10 +151,6 @@ protected override void Dispose(bool disposing) catch (Exception e) { e.ReportException(); - if (System.Diagnostics.Debugger.IsAttached) - { - System.Diagnostics.Debugger.Break(); - } } #pragma warning restore CA1031 // Do not catch general exception types } diff --git a/src/RuleSelection/RuleRunner.cs b/src/RuleSelection/RuleRunner.cs index 29f061276..a332aa681 100644 --- a/src/RuleSelection/RuleRunner.cs +++ b/src/RuleSelection/RuleRunner.cs @@ -27,11 +27,6 @@ public static void Run(A11yElement e) catch (Exception ex) { ex.ReportException(); - if (System.Diagnostics.Debugger.IsAttached) - { - System.Diagnostics.Debug.WriteLine(ex.ToString()); - System.Diagnostics.Debugger.Break(); - } } #pragma warning restore CA1031 // Do not catch general exception types } diff --git a/src/Rules/Conditions/Condition.cs b/src/Rules/Conditions/Condition.cs index 469150131..2063662df 100644 --- a/src/Rules/Conditions/Condition.cs +++ b/src/Rules/Conditions/Condition.cs @@ -74,6 +74,8 @@ public static Condition Create(DelegateCondition.MatchesDelegate d, string descr public static Condition True = Create(e => true, ConditionDescriptions.True); public static Condition False = Create(e => false, ConditionDescriptions.False); +#if DEBUG public static Condition DebugBreak = Create(e => { System.Diagnostics.Debugger.Break(); return true; }); +#endif } // class } // namespace diff --git a/src/RulesTest/MonsterTest.cs b/src/RulesTest/MonsterTest.cs index 706701473..c16efbb56 100644 --- a/src/RulesTest/MonsterTest.cs +++ b/src/RulesTest/MonsterTest.cs @@ -4,7 +4,6 @@ using Axe.Windows.Core.Enums; using Axe.Windows.UnitTestSharedLibrary; using System.Collections.Generic; -using System.IO; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting;