File tree 2 files changed +44
-7
lines changed
2 files changed +44
-7
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,43 @@ public async Task Customer_without_default_address_uses_first_address_using_data
172
172
Assert . Null ( ex ) ;
173
173
}
174
174
175
+ [ Fact ]
176
+ public void GetValues_null_rowversion_returns_empty_byte_array ( )
177
+ {
178
+ var con = GetConnection ( ) ;
179
+ using var command = con . CreateCommand ( ) ;
180
+ command . CommandText = "select cast(null as rowversion) rv" ;
181
+ using var reader = command . ExecuteReader ( ) ;
182
+ reader . Read ( ) ;
183
+ var data = new object [ 1 ] ;
184
+ reader . GetValues ( data ) ;
185
+ Assert . True ( data [ 0 ] is byte [ ] { Length : 0 } ) ;
186
+ }
187
+
188
+ [ Fact ]
189
+ public void GetValue_null_rowversion_returns_empty_byte_array ( )
190
+ {
191
+ var con = GetConnection ( ) ;
192
+ using var command = con . CreateCommand ( ) ;
193
+ command . CommandText = "select cast(null as rowversion) rv" ;
194
+ using var reader = command . ExecuteReader ( ) ;
195
+ reader . Read ( ) ;
196
+ var value = reader . GetValue ( 0 ) ;
197
+ Assert . True ( value is byte [ ] { Length : 0 } ) ;
198
+ }
199
+
200
+ [ Fact ]
201
+ public void GetFieldValue_null_rowversion_does_not_throw_invalid_cast ( )
202
+ {
203
+ var con = GetConnection ( ) ;
204
+ using var command = con . CreateCommand ( ) ;
205
+ command . CommandText = "select cast(null as rowversion) rv" ;
206
+ using var reader = command . ExecuteReader ( ) ;
207
+ reader . Read ( ) ;
208
+ var ex = Record . Exception ( ( ) => reader . GetFieldValue < byte [ ] > ( 0 ) ) ;
209
+ Assert . Null ( ex ) ;
210
+ }
211
+
175
212
private void AddCustomer ( Customer customer )
176
213
{
177
214
fixture . DataContext . Customers . Add ( customer ) ;
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ The test called "Customer_without_default_address_uses_first_address" fails.
12
12
The test can be made to pass if the version of Microsoft.Data.SqlClient is downgraded from
13
13
version 3.0.0 to 2.1.3 or line 156, ` builder.EnableRetryOnFailure(); ` , is commented out.
14
14
15
- The test called "Customer_without_default_address_uses_first_address_using_datareader_GetFieldValue" fails.
16
- The test can be made to pass if the version of Microsoft.Data.SqlClient is downgraded from
17
- version 3.0.0 to 2.1.3
18
-
19
- The test called "Customer_without_default_address_uses_first_address_using_datareader_GetValues" fails.
20
- The test can be made to pass if the version of Microsoft.Data.SqlClient is downgraded from
21
- version 3.0.0 to 2.1.3
15
+ The following tests fail:
16
+ * "Customer_without_default_address_uses_first_address_using_datareader_GetFieldValue"
17
+ * "Customer_without_default_address_uses_first_address_using_datareader_GetValues"
18
+ * "GetValues_null_rowversion_returns_empty_byte_array"
19
+ * "GetValue_null_rowversion_returns_empty_byte_array"
20
+ * "GetFieldValue_null_rowversion_does_not_throw_invalid_cast"
21
+ They can be made to pass if the version of Microsoft.Data.SqlClient is downgraded from version 3.0.0 to 2.1.3
22
22
23
23
# Schema generated by EF
24
24
You can’t perform that action at this time.
0 commit comments