Skip to content

Commit

Permalink
Add IDE tests for find references from field/prop used in property pa…
Browse files Browse the repository at this point in the history
…ttern

Closes dotnet#9073
  • Loading branch information
gafter committed Mar 3, 2016
1 parent 0de6840 commit 89128d1
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,34 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.FindReferences
Await TestAsync(input)
End Function

<WorkItem(9073, "https://github.com/dotnet/roslyn/issues/9073")>
<Fact, Trait(Traits.Feature, Traits.Features.FindReferences)>
Public Async Function TestCSharp_PatternField2() As Task
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>
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 })
{
}
}
}
</Document>
</Project>
</Workspace>
Await TestAsync(input)
End Function

<Fact, Trait(Traits.Feature, Traits.Features.FindReferences)>
Public Async Function TestField_VBInaccessibleInstanceProtectedField() As Task
Dim input =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,34 @@ class C
Await TestAsync(input)
End Function

<WorkItem(9073, "https://github.com/dotnet/roslyn/issues/9073")>
<Fact, Trait(Traits.Feature, Traits.Features.FindReferences)>
Public Async Function TestCSharp_PatternProperty2() As Task
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document>
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 })
{
}
}
}
</Document>
</Project>
</Workspace>
Await TestAsync(input)
End Function

<WorkItem(542881, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542881")>
<Fact, Trait(Traits.Feature, Traits.Features.FindReferences)>
Public Async Function TestBasic_AnonymousTypeProperties1() As Task
Expand Down

0 comments on commit 89128d1

Please sign in to comment.