/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/VisualStudio/LiveShare/Test/ProjectsHandlerTests.cs
40 строк
1 KB
Cyrus Najmabadi
Use implicit object creation expressions
13 сен 2025, 01:48
13 сен 2025, 01:48
4c6a36a
Код
Авторство
О чём код?
// 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. #nullable disable using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.LanguageServer; using Xunit; using Xunit.Abstractions; namespace Microsoft.VisualStudio.LanguageServices.LiveShare.UnitTests; public sealed class ProjectsHandlerTests : AbstractLiveShareRequestHandlerTests { public ProjectsHandlerTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } [Theory, CombinatorialData] public async Task TestProjectsAsync(bool mutatingLspWorkspace) { await using var testLspServer = await CreateTestLspServerAsync(string.Empty, mutatingLspWorkspace); var solution = testLspServer.GetCurrentSolution(); var expected = solution.Projects.Select(p => CreateLspProject(p)).ToArray(); var results = (CustomProtocol.Project[])await TestHandleAsync<object, object[]>(solution, null, CustomProtocol.RoslynMethods.ProjectsName); AssertJsonEquals(expected, results); } private static CustomProtocol.Project CreateLspProject(Project project) => new() { Language = project.Language, Name = project.Name, SourceFiles = [.. project.Documents.Select(document => document.GetURI().GetRequiredParsedUri())] }; }