Skip to content

Commit f085005

Browse files
committed
Separated Assert.Throws call
1 parent 29a3fa4 commit f085005

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Microsoft.Data.SqlClient/tests/ManualTests/ProviderAgnostic/MultipleResultsTest/MultipleResultsTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public void ExecuteNonQuery()
6060
command.CommandText = s_sqlStatement;
6161

6262
// ExecuteNonQuery will drain every result set, info message and exception, collating these into a single exception.
63-
SqlException exNonQuery = Assert.Throws<SqlException>(() => command.ExecuteNonQuery());
63+
Func<object> testCode = () => command.ExecuteNonQuery();
64+
SqlException exNonQuery = Assert.Throws<SqlException>(testCode);
6465

6566
string expectedInfoMessages = string.Join(Environment.NewLine,
6667
ResultSet2_Error, ResultSet4_Error, ResultSet6_Error, ResultSet8_Error, ResultSet10_Error,

0 commit comments

Comments
 (0)