Skip to content

Commit

Permalink
Merge pull request #9438 from gafter/patterns-9072b
Browse files Browse the repository at this point in the history
Add test for goto definition on a property pattern's member name.
  • Loading branch information
gafter committed Mar 3, 2016
2 parents 0de6840 + 672634c commit 2e0db2c
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions src/EditorFeatures/Test2/GoToDefinition/GoToDefinitionTests.vb
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,79 @@ class C
Await TestAsync(workspace)
End Function

<WpfFact, Trait(Traits.Feature, Traits.Features.GoToDefinition), WorkItem(9072, "https://github.com/dotnet/roslyn/issues/9072")>
Public Async Function TestCSharpGoToDefinitionFromPatternType01() As Task
Dim workspace =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document><![CDATA[
public class Expression { }
public class Constant : Expression
{
public readonly int Value;
public Constant(int Value)
{
this.Value = Value;
}
}
public class Plus : Expression
{
public readonly Expression [|Left|], Right;
public Plus(Expression Left, Expression Right)
{
this.Left = Left;
this.Right = Right;
}
}
public class X
{
public static void Main()
{
Expression expr = null;
if (expr is Plus { $$Left is Plus })
]]>
</Document>
</Project>
</Workspace>
Await TestAsync(workspace)
End Function

<WpfFact, Trait(Traits.Feature, Traits.Features.GoToDefinition), WorkItem(9072, "https://github.com/dotnet/roslyn/issues/9072")>
Public Async Function TestCSharpGoToDefinitionFromPatternType02() As Task
Dim workspace =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document><![CDATA[
public class Expression { }
public class Constant : Expression
{
public readonly int Value;
public Constant(int Value)
{
this.Value = Value;
}
}
public class Plus : Expression
{
public Expression [|Left|] => null;
public Plus(Expression Left)
{
this.Left = Left;
}
}
public class X
{
public static void Main()
{
Expression expr = null;
if (expr is Plus { $$Left is Plus })
]]>
</Document>
</Project>
</Workspace>
Await TestAsync(workspace)
End Function

#End Region

#Region "CSharp Venus Tests"
Expand Down

0 comments on commit 2e0db2c

Please sign in to comment.