Skip to content

Commit a8b7ee4

Browse files
committed
Addressing comments from copilot
1 parent ea468ff commit a8b7ee4

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

src/Microsoft.Data.SqlClient/tests/FunctionalTests/MultiplexerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ private static List<PacketData> MultiplexPacketList(bool isAsync, int dataSize,
270270
if (stateObject._inBytesRead > 0)
271271
{
272272
// At least the header must be read
273-
Assert.True(stateObject._inBytesRead < TdsEnums.HEADER_LEN);
273+
Assert.False(stateObject._inBytesRead < TdsEnums.HEADER_LEN);
274274

275275
// The full packet must be read, too
276276
Span<byte> header = stateObject._inBuff.AsSpan(0, TdsEnums.HEADER_LEN);

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/ParametersTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ private static void RunParameterTest()
10211021
object id2Value = cm.Parameters["@id2"].Value;
10221022
if (id2Value is not null)
10231023
{
1024-
// Null values are allowed, but must if it is not null, the expected guid must be set.
1024+
// Null values are allowed, but if it is not null, the expected guid must be set.
10251025
Assert.Equal(expectedGuid, (Guid)id2Value);
10261026
}
10271027
}

src/Microsoft.Data.SqlClient/tests/ManualTests/TracingTests/DiagnosticTest.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
using System.Runtime.CompilerServices;
2424
using System;
2525
using System.Data;
26+
using Microsoft.Data.SqlClient.Tests.Common;
2627
using Microsoft.DotNet.RemoteExecutor;
2728

2829
namespace Microsoft.Data.SqlClient.ManualTesting.Tests
@@ -211,7 +212,10 @@ public void ExecuteXmlReaderTest()
211212

212213
conn.Open();
213214
XmlReader reader = cmd.ExecuteXmlReader();
214-
reader.FlushResultSet();
215+
while (reader.Read())
216+
{
217+
// Flush results
218+
}
215219
}
216220
}, [WriteConnectionOpenBefore, WriteConnectionOpenAfter, WriteCommandBefore, WriteCommandAfter, WriteConnectionCloseBefore, WriteConnectionCloseAfter]);
217221
return RemoteExecutor.SuccessExitCode;
@@ -420,7 +424,10 @@ public void ExecuteXmlReaderAsyncTest()
420424

421425
conn.Open();
422426
XmlReader reader = await cmd.ExecuteXmlReaderAsync();
423-
reader.FlushResultSet();
427+
while (reader.Read())
428+
{
429+
// Flush results
430+
}
424431
}
425432
}, [WriteConnectionOpenBefore, WriteConnectionOpenAfter, WriteCommandBefore, WriteCommandAfter, WriteConnectionCloseBefore, WriteConnectionCloseAfter]).Wait();
426433
return RemoteExecutor.SuccessExitCode;

src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/SqlErrorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public void SerializationRoundTrip()
1616
{
1717
// Arrange
1818
DataContractSerializer serializer = new(typeof(SqlError));
19-
MemoryStream stream = new();
19+
using MemoryStream stream = new();
2020

2121
// - Create the test error
2222
SqlError originalError = new(

0 commit comments

Comments
 (0)