public void Exit()
        {
            // clean up Default SelectAction.
            SelectAction.ClearDefaultInstance();

            HostExitEvent.Set();
        }
        internal static void ValidateOneFile(string filePath, int expectedFailureCount,
                                             int expectedProcessId)
        {
            // Ideally, we'd use a Using block for SelectAction. Unfortunately, the
            // current code doesn't support this properly. Use ClearDefaultInstance
            // instead.
            try
            {
                SelectAction sa = SelectAction.GetDefaultInstance();
                sa.SelectLoadedData(filePath);

                List <(RuleResult Result, A11yElement Element)> failedResults = ExtractFailedResults(sa);

                Assert.AreEqual(expectedFailureCount, failedResults.Count);

                foreach (var failedResult in failedResults)
                {
                    ValidateOneRuleResult(failedResult.Result);
                    ValidateOneA11yElement(expectedProcessId, failedResult.Element);
                }
            }
            finally
            {
                SelectAction.ClearDefaultInstance();
            }
        }