protected void HasDiagnosticAtLine(string code, string diagnosticId, int lineNumber)
        {
            var document = CreateDocumentFromCode(code);
            var locator  = LineLocator.FromCode(code, lineNumber);

            HasDiagnostic(document, diagnosticId, locator);
        }
        protected void TestCodeRefactoringAtLine(string code, string expected, int line, int refactoringIndex = 0)
        {
            var document = MarkupHelper.GetDocumentFromCode(code, LanguageName, References);
            var locator  = LineLocator.FromCode(code, line);

            TestCodeRefactoring(document, expected, locator, refactoringIndex);
        }
        protected void TestCodeFixAtLine(string code, string expected, string diagnosticId, int line, int codeFixIndex = 0)
        {
            var document = MarkupHelper.GetDocumentFromMarkup(code, LanguageName, References);
            var locator  = LineLocator.FromCode(code, line);

            TestCodeFix(document, expected, diagnosticId, locator, codeFixIndex);
        }
        protected void TestCodeRefactoringAtLine(string code, string expected, int line, int refactoringIndex = 0)
        {
            var document = CreateDocumentFromCode(code);
            var locator  = LineLocator.FromCode(code, line);

            TestCodeRefactoring(document, expected, locator, new ByIndexCodeActionSelector(refactoringIndex));
        }
        protected void NoCodeFixAtLine(string code, string diagnosticId, int line)
        {
            var document = MarkupHelper.GetDocumentFromMarkup(code, LanguageName, References);
            var locator  = LineLocator.FromCode(code, line);

            NoCodeFix(document, diagnosticId, locator);
        }
        protected void HasDiagnosticAtLine(string code, string diagnosticId, int lineNumber)
        {
            var document = MarkupHelper.GetDocumentFromCode(code, LanguageName, References);
            var locator  = LineLocator.FromCode(code, lineNumber);

            HasDiagnostic(document, diagnosticId, locator);
        }
        protected void TestCodeFixAtLine(string code, string expected, string diagnosticId, int line, int codeFixIndex = 0)
        {
            var document = CreateDocumentFromCode(code);
            var locator  = LineLocator.FromCode(code, line);

            TestCodeFix(document, expected, diagnosticId, locator, new ByIndexCodeActionSelector(codeFixIndex));
        }
        protected void NoCodeFixAtLine(string code, string diagnosticId, int line)
        {
            var document = CreateDocumentFromCode(code);
            var locator  = LineLocator.FromCode(code, line);

            NoCodeFix(document, diagnosticId, locator);
        }
        protected void TestCodeFixAtLine(string code, string expected, DiagnosticDescriptor descriptor, int line, int codeFixIndex = 0)
        {
            var document   = MarkupHelper.GetDocumentFromMarkup(code, LanguageName, References);
            var locator    = LineLocator.FromCode(code, line);
            var diagnostic = FindOrCreateDiagnosticForDescriptor(document, descriptor, locator);

            TestCodeFix(document, expected, diagnostic, locator, codeFixIndex);
        }
        protected void TestCodeFixAtLine(string code, string expected, DiagnosticDescriptor descriptor, int line, int codeFixIndex = 0)
        {
            var document   = CreateDocumentFromCode(code);
            var locator    = LineLocator.FromCode(code, line);
            var diagnostic = FindOrCreateDiagnosticForDescriptor(document, descriptor, locator);

            TestCodeFix(document, expected, diagnostic, locator, new ByIndexCodeActionSelector(codeFixIndex));
        }
        protected void NoCodeFixAtLine(string code, DiagnosticDescriptor descriptor, int line)
        {
            var document   = CreateDocumentFromCode(code);
            var locator    = LineLocator.FromCode(code, line);
            var diagnostic = FindOrCreateDiagnosticForDescriptor(document, descriptor, locator);

            NoCodeFix(document, diagnostic, locator);
        }