/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/VisualStudio/ExternalAccess/Test/FSharp/FSharpNavigateToMatchKindTests.cs
89 строк
3 KB
Joey Robichaud
Consolidate ExternalAccess libraries (#81593)
07 июл 2026, 23:16
Не верифицирован
07 июл 2026, 23:16
97ee762
Код
Авторство
О чём код?
// 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; using System.Collections.Generic; using Microsoft.CodeAnalysis.ExternalAccess.FSharp.Internal.NavigateTo; using Microsoft.CodeAnalysis.ExternalAccess.FSharp.NavigateTo; using Microsoft.CodeAnalysis.NavigateTo; using Xunit; namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.UnitTests; public class FSharpNavigateToMatchKindTests { public static IEnumerable<object[]> enumValues() { foreach (var number in Enum.GetValues(typeof(FSharpNavigateToMatchKind))) { yield return new object[] { number }; } } internal static NavigateToMatchKind GetExpectedNavigateToMatchKind(FSharpNavigateToMatchKind kind) { switch (kind) { case FSharpNavigateToMatchKind.Exact: { return NavigateToMatchKind.Exact; } case FSharpNavigateToMatchKind.Prefix: { return NavigateToMatchKind.Prefix; } case FSharpNavigateToMatchKind.Substring: { return NavigateToMatchKind.Substring; } case FSharpNavigateToMatchKind.Regular: { return NavigateToMatchKind.Regular; } case FSharpNavigateToMatchKind.None: { return NavigateToMatchKind.None; } case FSharpNavigateToMatchKind.CamelCaseExact: { return NavigateToMatchKind.CamelCaseExact; } case FSharpNavigateToMatchKind.CamelCasePrefix: { return NavigateToMatchKind.CamelCasePrefix; } case FSharpNavigateToMatchKind.CamelCaseNonContiguousPrefix: { return NavigateToMatchKind.CamelCaseNonContiguousPrefix; } case FSharpNavigateToMatchKind.CamelCaseSubstring: { return NavigateToMatchKind.CamelCaseSubstring; } case FSharpNavigateToMatchKind.CamelCaseNonContiguousSubstring: { return NavigateToMatchKind.CamelCaseNonContiguousSubstring; } case FSharpNavigateToMatchKind.Fuzzy: { return NavigateToMatchKind.Fuzzy; } default: { throw ExceptionUtilities.UnexpectedValue(kind); } } } [Theory] [MemberData(nameof(enumValues))] internal void MapsCorrectly(FSharpNavigateToMatchKind kind) { var actual = FSharpNavigateToMatchKindHelpers.ConvertTo(kind); var expected = GetExpectedNavigateToMatchKind(kind); Assert.Equal(expected, actual); } }