Skip to content

Commit ab82654

Browse files
committed
Reapply IDE0090 recommendations, disable CS1591 on newly-added tests
1 parent 3f054c7 commit ab82654

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlTypes/SqlTypeWorkaroundsTests.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Xunit;
99

1010
#nullable enable
11+
#pragma warning disable CS1591 // Test classes do not require XML documentation comments
1112

1213
namespace Microsoft.Data.SqlClient.UnitTests
1314
{
@@ -20,7 +21,7 @@ public class SqlTypeWorkaroundsTests
2021
#region SqlBinary
2122

2223
public static TheoryData<byte[]> ByteArrayToSqlBinary_NonNullInput_Data =>
23-
new TheoryData<byte[]>
24+
new()
2425
{
2526
Array.Empty<byte>(),
2627
new byte[] { 1, 2, 3, 4},
@@ -53,7 +54,7 @@ public void ByteArrayToSqlBinary_NullInput()
5354
#region SqlDecimal
5455

5556
public static TheoryData<SqlDecimal> SqlDecimalWriteTdsValue_NonNullInput_Data =>
56-
new TheoryData<SqlDecimal>
57+
new()
5758
{
5859
SqlDecimal.MinValue,
5960
new SqlDecimal(-1.2345678),
@@ -102,7 +103,7 @@ public void SqlDecimalWriteTdsValue_NullInput()
102103
#region SqlGuid
103104

104105
public static TheoryData<byte[]?> ByteArrayToSqlGuid_InvalidInput_Data =>
105-
new TheoryData<byte[]?>
106+
new()
106107
{
107108
null,
108109
Array.Empty<byte>(),
@@ -122,7 +123,7 @@ public void ByteArrayToSqlGuid_InvalidInput(byte[]? input)
122123
}
123124

124125
public static TheoryData<byte[]> ByteArrayToSqlGuid_ValidInput_Data =>
125-
new TheoryData<byte[]>
126+
new()
126127
{
127128
new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
128129
new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }
@@ -145,7 +146,7 @@ public void ByteArrayToSqlGuid_ValidInput(byte[] input)
145146
#region SqlMoney
146147

147148
public static TheoryData<long, SqlMoney> LongToSqlMoney_Data =>
148-
new TheoryData<long, SqlMoney>
149+
new()
149150
{
150151
{ long.MinValue, SqlMoney.MinValue },
151152
{ (long)((decimal)-123000000 / 10000), new SqlMoney(-1.23) },
@@ -166,7 +167,7 @@ public void LongToSqlMoney(long input, SqlMoney expected)
166167
}
167168

168169
public static TheoryData<SqlMoney, long> SqlMoneyToLong_NonNullInput_Data =>
169-
new TheoryData<SqlMoney, long>
170+
new()
170171
{
171172
{ SqlMoney.MinValue, long.MinValue },
172173
{ new SqlMoney(-1.23), (long)(new SqlMoney(-1.23).ToDecimal() * 10000) },
@@ -204,3 +205,5 @@ public void SqlMoneyToLong_NullInput()
204205
#endif
205206
}
206207
}
208+
209+
#pragma warning restore CS1591

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Xunit;
99

1010
#nullable enable
11+
#pragma warning disable CS1591 // Test classes do not require XML documentation comments
1112

1213
namespace Microsoft.Data.SqlClient.UnitTests
1314
{
@@ -92,7 +93,7 @@ public void WriteUserAgentFeatureRequest_WriteTrue_AppendsOnlyExtensionBytes()
9293
bufferAfter[start + 5]);
9394

9495
// slice into the existing buffer
95-
ReadOnlySpan<byte> writtenSpan = new ReadOnlySpan<byte>(
96+
ReadOnlySpan<byte> writtenSpan = new(
9697
bufferAfter,
9798
start + 6,
9899
appended - 6);
@@ -105,3 +106,5 @@ public void WriteUserAgentFeatureRequest_WriteTrue_AppendsOnlyExtensionBytes()
105106

106107
}
107108
}
109+
110+
#pragma warning restore CS1591

0 commit comments

Comments
 (0)