提交 8b547268 编写于 作者: D Dustin Campbell

Add failing unit tests for #8412

上级 b8d7a15f
......@@ -165,6 +165,7 @@
<Compile Include="CallHierarchy\CallHierarchyTests.vb" />
<Compile Include="Diagnostics\InMemoryAssemblyLoader.vb" />
<Compile Include="Diagnostics\UseAutoProperty\UseAutoPropertyTests.vb" />
<Compile Include="Expansion\LambdaParameterExpansionTests.vb" />
<Compile Include="GoToImplementation\GoToImplementationTests.vb" />
<Compile Include="InteractivePaste\InteractivePasteCommandHandlerTests.vb" />
<Compile Include="IntelliSense\CompletionRulesTests.vb" />
......@@ -316,4 +317,4 @@
<Import Project="..\..\..\build\Targets\VSL.Imports.targets" />
<Import Project="..\..\..\build\Targets\Roslyn.Toolsets.Xunit.targets" />
</ImportGroup>
</Project>
</Project>
\ No newline at end of file
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Threading.Tasks
Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Expansion
Public Class LambdaParameterExpansionTests
Inherits AbstractExpansionTest
<Fact, Trait(Traits.Feature, Traits.Features.Expansion)>
Public Async Function TestCSharp_ExpandLambdaWithNoParameters() As Task
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document><![CDATA[
using System;
class C
{
void M()
{
Action a = {|Expand:() => { }|};
}
}
]]></Document>
</Project>
</Workspace>
Dim expected =
<code>
using System;
class C
{
void M()
{
Action a = () => { };
}
}
</code>
Await TestAsync(input, expected, expandParameter:=True)
End Function
<Fact, Trait(Traits.Feature, Traits.Features.Expansion)>
Public Async Function TestCSharp_ExpandLambdaWithSingleParameters_NoParens() As Task
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document><![CDATA[
using System;
class C
{
void M()
{
Action<int> a = {|Expand:x => { }|};
}
}
]]></Document>
</Project>
</Workspace>
Dim expected =
<code><![CDATA[
using System;
class C
{
void M()
{
Action<int> a = (System.Int32 x) => { };
}
}
]]></code>
Await TestAsync(input, expected, expandParameter:=True)
End Function
<Fact, Trait(Traits.Feature, Traits.Features.Expansion)>
Public Async Function TestCSharp_ExpandLambdaWithSingleParameters_WithParens() As Task
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document><![CDATA[
using System;
class C
{
void M()
{
Action<int> a = {|Expand:(x) => { }|};
}
}
]]></Document>
</Project>
</Workspace>
Dim expected =
<code><![CDATA[
using System;
class C
{
void M()
{
Action<int> a = (System.Int32 x) => { };
}
}
]]></code>
Await TestAsync(input, expected, expandParameter:=True)
End Function
<Fact, Trait(Traits.Feature, Traits.Features.Expansion)>
Public Async Function TestCSharp_ExpandLambdaWithTwoParameters() As Task
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document><![CDATA[
using System;
class C
{
void M()
{
Action<int, int> a = {|Expand:(x, y) => { }|};
}
}
]]></Document>
</Project>
</Workspace>
Dim expected =
<code><![CDATA[
using System;
class C
{
void M()
{
Action<int, int> a = (System.Int32 x, System.Int32 y) => { };
}
}
]]></code>
Await TestAsync(input, expected, expandParameter:=True)
End Function
<Fact, Trait(Traits.Feature, Traits.Features.Expansion)>
Public Async Function TestCSharp_ExpandLambdaWithThreearameters() As Task
Dim input =
<Workspace>
<Project Language="C#" CommonReferences="true">
<Document><![CDATA[
using System;
class C
{
void M()
{
Action<int, int, int> a = {|Expand:(x, y, z) => { }|};
}
}
]]></Document>
</Project>
</Workspace>
Dim expected =
<code><![CDATA[
using System;
class C
{
void M()
{
Action<int, int, int> a = (System.Int32 x, System.Int32 y, System.Int32 z) => { };
}
}
]]></code>
Await TestAsync(input, expected, expandParameter:=True)
End Function
End Class
End Namespace
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册