コード例 #1
0
        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);
        }
コード例 #2
0
        protected void TestNoCodeRefactoring(string markupCode)
        {
            var document = MarkupHelper.GetDocumentFromMarkup(markupCode, LanguageName, References);
            var locator  = MarkupHelper.GetLocator(markupCode);

            TestNoCodeRefactoring(document, locator);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        protected void NoCodeFix(string markupCode, string diagnosticId)
        {
            var document = MarkupHelper.GetDocumentFromMarkup(markupCode, LanguageName, References);
            var locator  = MarkupHelper.GetLocator(markupCode);

            NoCodeFix(document, diagnosticId, locator);
        }
コード例 #5
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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
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);
        }
コード例 #9
0
 protected IDiagnosticLocator GetMarkerLocation(string markupCode)
 {
     return(MarkupHelper.GetLocator(markupCode));
 }