/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/EditorFeatures/Test2/GoToBase/GoToBaseTestsBase.vb
39 строк
2 KB
Tomáš Matoušek
Test layering fixes (#76749)
16 янв 2025, 01:15
Не верифицирован
16 янв 2025, 01:15
81afe92
Код
Авторство
О чём код?
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Threading Imports Microsoft.CodeAnalysis.Classification Imports Microsoft.CodeAnalysis.FindUsages Imports Microsoft.CodeAnalysis.GoToBase Imports Microsoft.CodeAnalysis.Remote.Testing Namespace Microsoft.CodeAnalysis.Editor.UnitTests.GoToBase Public MustInherit Class GoToBaseTestsBase Protected Shared Async Function TestAsync(workspaceDefinition As XElement, Optional shouldSucceed As Boolean = True, Optional metadataDefinitions As String() = Nothing) As Task Await GoToHelpers.TestAsync( workspaceDefinition, testHost:=TestHost.InProcess, Async Function(document As Document, position As Integer, context As SimpleFindUsagesContext) Dim gotoBaseService = document.GetLanguageService(Of IGoToBaseService) Dim options = TestOptionsProvider.Create(ClassificationOptions.Default) Await gotoBaseService.FindBasesAsync(context, document, position, options, CancellationToken.None) End Function, shouldSucceed, metadataDefinitions) End Function Protected Shared Async Function TestAsync(source As String, language As String, Optional shouldSucceed As Boolean = True, Optional metadataDefinitions As String() = Nothing) As Task Await TestAsync( <Workspace> <Project Language=<%= language %> CommonReferences="true"> <Document> <%= source %> </Document> </Project> </Workspace>, shouldSucceed, metadataDefinitions) End Function End Class End Namespace