From 8e22a513ca6d1a1cc621675bbc7db03f2994a8fd Mon Sep 17 00:00:00 2001 From: chborl Date: Wed, 27 Sep 2017 16:56:46 -0700 Subject: [PATCH] Added tests for `out` and `ref` completion in local function Tests in response to issue #22253 --- .../Recommendations/OutKeywordRecommenderTests.cs | 8 ++++++++ .../Recommendations/RefKeywordRecommenderTests.cs | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/src/EditorFeatures/CSharpTest2/Recommendations/OutKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest2/Recommendations/OutKeywordRecommenderTests.cs index de9a2bd57847d..31cf14e6b47c6 100644 --- a/src/EditorFeatures/CSharpTest2/Recommendations/OutKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest2/Recommendations/OutKeywordRecommenderTests.cs @@ -405,5 +405,13 @@ void main(out goo) { } await VerifyKeywordAsync(text); } + + [WorkItem(22253, "https://github.com/dotnet/roslyn/issues/22253")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public async Task TestInLocalFunction() + { + await VerifyKeywordAsync(AddInsideMethod( +@"void F(int x, $$")); + } } } diff --git a/src/EditorFeatures/CSharpTest2/Recommendations/RefKeywordRecommenderTests.cs b/src/EditorFeatures/CSharpTest2/Recommendations/RefKeywordRecommenderTests.cs index 70c9babd47d88..b9c12eda1f81e 100644 --- a/src/EditorFeatures/CSharpTest2/Recommendations/RefKeywordRecommenderTests.cs +++ b/src/EditorFeatures/CSharpTest2/Recommendations/RefKeywordRecommenderTests.cs @@ -822,6 +822,15 @@ public async Task TestInConditionalExpressionFalseBranch() await VerifyKeywordWithRefsAsync(AddInsideMethod(@" int x = 0; ref int y = ref true ? ref x : $$")); + } + + [WorkItem(22253, "https://github.com/dotnet/roslyn/issues/22253")] + [Fact, Trait(Traits.Feature, Traits.Features.KeywordRecommending)] + public async Task TestInLocalMethod() + { + await VerifyKeywordWithRefsAsync(AddInsideMethod( +@" void Goo(int test, $$) ")); + } } }