/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/EditorFeatures/CSharpTest2/Recommendations/FileKeywordRecommenderTests.cs
187 строк
4 KB
copilot-swe-agent[bot]
Fix indentation in FileKeywordRecommenderTests
17 окт 2025, 02:15
17 окт 2025, 02:15
9b3ecb1
Код
Авторство
О чём код?
// 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. using System.Threading.Tasks; using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Recommendations; [Trait(Traits.Feature, Traits.Features.KeywordRecommending)] public sealed class FileKeywordRecommenderTests : KeywordRecommenderTests { [Fact] public Task TestAtRoot() => VerifyKeywordAsync( @"$$"); [Fact] public Task TestAfterClass() => VerifyKeywordAsync( """ class C { } $$ """); [Fact] public Task TestNotInUsingAlias() => VerifyAbsenceAsync( @"using Goo = $$"); [Fact] public Task TestNotInGlobalUsingAlias() => VerifyAbsenceAsync( @"global using Goo = $$"); [Fact] public Task TestNotInEmptyStatement() => VerifyAbsenceAsync(AddInsideMethod( @"$$")); [Fact] public Task TestAfterExternAlias() => VerifyKeywordAsync( """ extern alias Goo; $$ """); [Fact] public Task TestAfterUsing() => VerifyKeywordAsync(""" using Goo; $$ """); [Fact] public Task TestAfterGlobalUsing() => VerifyKeywordAsync( """ global using Goo; $$ """); [Fact] public Task TestAfterNamespace() => VerifyKeywordAsync(""" namespace N {} $$ """); [Fact] public Task TestInsideNamespace() => VerifyKeywordAsync( """ namespace N { $$ """); [Fact] public Task TestInsideFileScopedNamespace() => VerifyKeywordAsync( """ namespace N; $$ """); [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/81028")] public Task TestNotAfterExternKeyword() => VerifyAbsenceAsync( @"extern $$"); [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/81028")] public Task TestNotAfterExternKeyword_InsideNamespace() => VerifyAbsenceAsync(""" namespace N { extern $$ """); [Fact] public Task TestAfterPreviousExternAlias_InsideNamespace() => VerifyKeywordAsync( """ namespace N { extern alias Goo; $$ """); [Fact] public Task TestAfterUsing_InsideNamespace() => VerifyKeywordAsync(""" namespace N { using Goo; $$ """); [Fact] public Task TestAfterMember_InsideNamespace() => VerifyKeywordAsync(""" namespace N { class C {} $$ """); [Fact] public Task TestNotInClass() => VerifyAbsenceAsync( """ class C { $$ """); [Fact] public Task TestNotInStruct() => VerifyAbsenceAsync( """ struct S { $$ """); [Fact] public Task TestNotInInterface() => VerifyAbsenceAsync( """ interface I { $$ """); [Fact] public Task TestNotInRecord() => VerifyAbsenceAsync( """ record R { $$ """); [Fact] public Task TestNotAfterPublic() => VerifyAbsenceAsync( @"public $$"); [Fact] public Task TestNotAfterInternal() => VerifyAbsenceAsync( @"internal $$"); [Fact] public Task TestAfterStatic() => VerifyKeywordAsync( @"static $$"); [Fact] public Task TestAfterPartial() => VerifyKeywordAsync( @"partial $$"); [Fact] public Task TestAfterAbstract() => VerifyKeywordAsync( @"abstract $$"); [Fact] public Task TestAfterSealed() => VerifyKeywordAsync( @"sealed $$"); }