/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/EditorFeatures/Test/CodeGeneration/StatementGenerationTests.cs
68 строк
2 KB
Cyrus Najmabadi
Cleanup test methods
24 июл 2025, 11:15
24 июл 2025, 11:15
9b3e554
Код
Авторство
О чём код?
// 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 Microsoft.CodeAnalysis.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.Editor.UnitTests.CodeGeneration; [Trait(Traits.Feature, Traits.Features.CodeGeneration)] public sealed class StatementGenerationTests : AbstractCodeGenerationTests { [Fact] public void TestThrowStatement1() => Test(f => f.ThrowStatement(), cs: "throw;", csSimple: null, vb: "Throw", vbSimple: null); [Fact] public void TestThrowStatement2() => Test(f => f.ThrowStatement( f.IdentifierName("e")), cs: "throw e;", csSimple: null, vb: "Throw e", vbSimple: null); [Fact] public void TestThrowStatement3() => Test(f => f.ThrowStatement( f.ObjectCreationExpression( CreateClass("NotImplementedException"))), cs: "throw new NotImplementedException();", csSimple: null, vb: "Throw New NotImplementedException()", vbSimple: null); [Fact] public void TestReturnStatement1() => Test(f => f.ReturnStatement(), cs: "return;", csSimple: null, vb: "Return", vbSimple: null); [Fact] public void TestReturnStatement2() => Test(f => f.ReturnStatement( f.IdentifierName("e")), cs: "return e;", csSimple: null, vb: "Return e", vbSimple: null); [Fact] public void TestReturnStatement3() => Test(f => f.ReturnStatement( f.ObjectCreationExpression( CreateClass("NotImplementedException"))), cs: "return new NotImplementedException();", csSimple: null, vb: "Return New NotImplementedException()", vbSimple: null); }