From 89128d17906f0f74cfb454f24d366fcf6be28482 Mon Sep 17 00:00:00 2001 From: Neal Gafter Date: Wed, 2 Mar 2016 21:02:24 -0800 Subject: [PATCH] Add IDE tests for find references from field/prop used in property pattern Closes #9073 --- .../FindReferencesTests.FieldSymbols.vb | 28 +++++++++++++++++++ .../FindReferencesTests.PropertySymbols.vb | 28 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.FieldSymbols.vb b/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.FieldSymbols.vb index 5a6c832e01752..719b55e097e83 100644 --- a/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.FieldSymbols.vb +++ b/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.FieldSymbols.vb @@ -271,6 +271,34 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.FindReferences Await TestAsync(input) End Function + + + Public Async Function TestCSharp_PatternField2() As Task + Dim input = + + + + public class Expression { } + public class Plus : Expression + { + public Expression {|Definition:Left|} = null; + } + public class X + { + public static void Main() + { + Expression expr = null; + if (expr is Plus { [|Le$$ft|] is Plus }) + { + } + } + } + + + + Await TestAsync(input) + End Function + Public Async Function TestField_VBInaccessibleInstanceProtectedField() As Task Dim input = diff --git a/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.PropertySymbols.vb b/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.PropertySymbols.vb index a937bad9cd565..f5ee4b81d3ec7 100644 --- a/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.PropertySymbols.vb +++ b/src/EditorFeatures/Test2/FindReferences/FindReferencesTests.PropertySymbols.vb @@ -611,6 +611,34 @@ class C Await TestAsync(input) End Function + + + Public Async Function TestCSharp_PatternProperty2() As Task + Dim input = + + + + public class Expression { } + public class Plus : Expression + { + public Expression {|Definition:Left|} => null; + } + public class X + { + public static void Main() + { + Expression expr = null; + if (expr is Plus { [|Le$$ft|] is Plus }) + { + } + } + } + + + + Await TestAsync(input) + End Function + Public Async Function TestBasic_AnonymousTypeProperties1() As Task