protected void TestNoCodeRefactoring(string markupCode)
        {
            var document = MarkupHelper.GetDocumentFromMarkup(markupCode, LanguageName, References);
            var locator  = MarkupHelper.GetLocator(markupCode);

            TestNoCodeRefactoring(document, locator);
        }
        protected void TestCodeFix(string markupCode, string expected, string diagnosticId, int codeFixIndex = 0)
        {
            var document = MarkupHelper.GetDocumentFromMarkup(markupCode, LanguageName, References);
            var locator  = MarkupHelper.GetLocator(markupCode);

            TestCodeFix(document, expected, diagnosticId, locator, codeFixIndex);
        }
        protected void TestCodeRefactoring(string markupCode, string expected, int refactoringIndex = 0)
        {
            var document = MarkupHelper.GetDocumentFromMarkup(markupCode, LanguageName, References);
            var locator  = MarkupHelper.GetLocator(markupCode);

            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 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 NoCodeFix(string markupCode, string diagnosticId)
        {
            var document = MarkupHelper.GetDocumentFromMarkup(markupCode, LanguageName, References);
            var locator  = MarkupHelper.GetLocator(markupCode);

            NoCodeFix(document, diagnosticId, locator);
        }
Esempio n. 7
0
        protected void TestCompletion(string markupCode, Action <ImmutableArray <CompletionItem> > assertion, CompletionTrigger?trigger = null)
        {
            var document = MarkupHelper.GetDocumentFromMarkup(markupCode, LanguageName, References);
            var locator  = MarkupHelper.GetLocator(markupCode);

            VerifyExpectations(document, locator, trigger, assertion);
        }
        protected void TestCodeFix(string markupCode, string expected, DiagnosticDescriptor descriptor, int codeFixIndex = 0)
        {
            var document   = MarkupHelper.GetDocumentFromMarkup(markupCode, LanguageName, References);
            var locator    = MarkupHelper.GetLocator(markupCode);
            var diagnostic = FindOrCreateDiagnosticForDescriptor(document, descriptor, locator);

            TestCodeFix(document, expected, diagnostic, locator, codeFixIndex);
        }
        protected void NoCodeFix(string markupCode, DiagnosticDescriptor descriptor)
        {
            var document   = MarkupHelper.GetDocumentFromMarkup(markupCode, LanguageName, References);
            var locator    = MarkupHelper.GetLocator(markupCode);
            var diagnostic = FindOrCreateDiagnosticForDescriptor(document, descriptor, locator);

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

            NoCodeFix(document, diagnostic, locator);
        }
Esempio n. 11
0
        protected void TestCompletion(string markupCode, string[] expectedCompletions, CompletionTrigger?trigger = null)
        {
            var document  = MarkupHelper.GetDocumentFromMarkup(markupCode, LanguageName, References);
            var locator   = MarkupHelper.GetLocator(markupCode);
            var assertion = CreateAssertionBasedOnExpectedSet(expectedCompletions, locator);

            VerifyExpectations(document, locator, trigger, assertion);
        }
Esempio n. 12
0
 protected Document CreateDocumentFromMarkup(string markup, string projectName = null, string documentName = null)
 {
     return(MarkupHelper.GetDocumentFromMarkup(markup, LanguageName, References, projectName, documentName));
 }