-
Notifications
You must be signed in to change notification settings - Fork 235
Expand file tree
/
Copy pathLambdaTests.cs
More file actions
56 lines (48 loc) · 1.51 KB
/
LambdaTests.cs
File metadata and controls
56 lines (48 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System.Threading.Tasks;
using ICSharpCode.CodeConverter.Tests.TestRunners;
using Xunit;
namespace ICSharpCode.CodeConverter.Tests.CSharp.ExpressionTests;
public class LambdaTests : ConverterTestBase
{
[Fact]
public async Task Issue1012_MultiLineLambdaWithSingleStatement()
{
await TestConversionVisualBasicToCSharpAsync(@"Imports System.Collections.Generic
Imports System.Linq
Imports System.Threading.Tasks
Public Class ConversionTest3
Private Class MyEntity
Property EntityId As Integer
Property Name As String
End Class
Private Sub BugRepro()
Dim entities As New List(Of MyEntity)
Parallel.For(1, 3, Sub(i As Integer)
Dim result As String = (From e In entities
Where e.EntityId = 123
Select e.Name).Single
End Sub)
End Sub
End Class", @"using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
public partial class ConversionTest3
{
private partial class MyEntity
{
public int EntityId { get; set; }
public string Name { get; set; }
}
private void BugRepro()
{
var entities = new List<MyEntity>();
Parallel.For(1, 3, (i) =>
{
string result = (from e in entities
where e.EntityId == 123
select e.Name).Single();
});
}
}");
}
}