Skip to content

Commit 370419e

Browse files
committed
Use of LINQ
1 parent e73293e commit 370419e

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

tests/MongoDB.Driver.Tests/Specifications/socks5-support/Socks5SupportProseTests.cs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,19 @@ public static IEnumerable<object[]> GetTestCombinations()
6060
("mongodb://<replicaset>/?proxyHost=localhost&proxyPort=1081", true)
6161
};
6262

63-
var index = 0;
64-
foreach (var (connectionString, expectedResult) in testCases)
65-
{
66-
foreach (var useTls in new[] { true, false })
63+
return
64+
(from tc in testCases
65+
from useTls in new[] { true, false }
66+
from isAsync in new[] { true, false }
67+
select new { tc.ConnectionString, tc.ExpectedResult, useTls, isAsync })
68+
.Select((x, i) => new object[]
6769
{
68-
foreach (var isAsync in new[] { true, false })
69-
{
70-
var id = $"{index++}_{(useTls ? "Tls" : "NoTls")}_{(isAsync ? "Async" : "Sync")}";
71-
yield return [id, connectionString, expectedResult, useTls, isAsync];
72-
}
73-
}
74-
}
70+
$"{i}_{(x.useTls ? "Tls" : "NoTls")}_{(x.isAsync ? "Async" : "Sync")}",
71+
x.ConnectionString,
72+
x.ExpectedResult,
73+
x.useTls,
74+
x.isAsync
75+
});
7576
}
7677

7778
[Theory]

0 commit comments

Comments
 (0)