/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Features/CSharpTest/Snippets/CSharpPropSnippetProviderTests.cs
60 строк
2 KB
Cyrus Najmabadi
Make tests non-async
08 июл 2025, 01:59
08 июл 2025, 01:59
c0736fd
Код
Авторство
О чём код?
// 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 Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests.Snippets; public sealed class CSharpPropSnippetProviderTests : AbstractCSharpAutoPropertySnippetProviderTests { protected override string SnippetIdentifier => "prop"; protected override string DefaultPropertyBlockText => "{ get; set; }"; public override Task InsertSnippetInReadonlyStructTest() => VerifyPropertyAsync(""" readonly struct MyStruct { $$ } """, "public {|0:int|} {|1:MyProperty|} { get; }"); public override Task InsertSnippetInReadonlyStructTest_ReadonlyModifierInOtherPartialDeclaration() => VerifyPropertyAsync(""" partial struct MyStruct { $$ } readonly partial struct MyStruct { } """, "public {|0:int|} {|1:MyProperty|} { get; }"); public override Task InsertSnippetInReadonlyStructTest_ReadonlyModifierInOtherPartialDeclaration_MissingPartialModifier() => VerifyPropertyAsync(""" struct MyStruct { $$ } readonly partial struct MyStruct { } """, "public {|0:int|} {|1:MyProperty|} { get; }"); public override Task VerifySnippetInInterfaceTest() => VerifyDefaultPropertyAsync(""" interface MyInterface { $$ } """); [Theory] [MemberData(nameof(CommonSnippetTestData.AllAccessibilityModifiers), MemberType = typeof(CommonSnippetTestData))] public override Task InsertSnippetAfterAllowedAccessibilityModifierTest(string modifier) => base.InsertSnippetAfterAllowedAccessibilityModifierTest(modifier); }