@@ -718,7 +718,7 @@ public virtual void GetTextReader_throws_for_null_String()
718
718
command . CommandText = Fixture . CreateSelectSql ( DbType . String , ValueKind . Null ) ;
719
719
using var reader = command . ExecuteReader ( ) ;
720
720
reader . Read ( ) ;
721
- Assert . Throws < InvalidCastException > ( ( ) => reader . GetTextReader ( 0 ) ) ;
721
+ Assert . Throws ( Fixture . NullValueExceptionType , ( ) => reader . GetTextReader ( 0 ) ) ;
722
722
}
723
723
724
724
[ Fact ]
@@ -753,7 +753,7 @@ public virtual void GetFieldValue_for_TextReader_throws_for_null_String()
753
753
command . CommandText = Fixture . CreateSelectSql ( DbType . String , ValueKind . Null ) ;
754
754
using var reader = command . ExecuteReader ( ) ;
755
755
reader . Read ( ) ;
756
- Assert . Throws < InvalidCastException > ( ( ) => reader . GetFieldValue < TextReader > ( 0 ) ) ;
756
+ Assert . Throws ( Fixture . NullValueExceptionType , ( ) => reader . GetFieldValue < TextReader > ( 0 ) ) ;
757
757
}
758
758
759
759
[ Fact ]
@@ -764,7 +764,7 @@ public virtual async Task GetFieldValueAsync_for_TextReader_throws_for_null_Stri
764
764
command . CommandText = Fixture . CreateSelectSql ( DbType . String , ValueKind . Null ) ;
765
765
using var reader = await command . ExecuteReaderAsync ( ) ;
766
766
await reader . ReadAsync ( ) ;
767
- await Assert . ThrowsAsync < InvalidCastException > ( async ( ) => await reader . GetFieldValueAsync < TextReader > ( 0 ) ) ;
767
+ await Assert . ThrowsAsync ( Fixture . NullValueExceptionType , async ( ) => await reader . GetFieldValueAsync < TextReader > ( 0 ) ) ;
768
768
}
769
769
770
770
[ Fact ]
@@ -799,7 +799,7 @@ public virtual void GetFieldValue_for_Stream_throws_for_null_Binary()
799
799
command . CommandText = Fixture . CreateSelectSql ( DbType . Binary , ValueKind . Null ) ;
800
800
using var reader = command . ExecuteReader ( ) ;
801
801
reader . Read ( ) ;
802
- Assert . Throws < InvalidCastException > ( ( ) => reader . GetFieldValue < Stream > ( 0 ) ) ;
802
+ Assert . Throws ( Fixture . NullValueExceptionType , ( ) => reader . GetFieldValue < Stream > ( 0 ) ) ;
803
803
}
804
804
805
805
[ Fact ]
@@ -810,7 +810,7 @@ public virtual async Task GetFieldValueAsync_for_Stream_throws_for_null_Binary()
810
810
command . CommandText = Fixture . CreateSelectSql ( DbType . Binary , ValueKind . Null ) ;
811
811
using var reader = await command . ExecuteReaderAsync ( ) ;
812
812
await reader . ReadAsync ( ) ;
813
- await Assert . ThrowsAsync < InvalidCastException > ( async ( ) => await reader . GetFieldValueAsync < Stream > ( 0 ) ) ;
813
+ await Assert . ThrowsAsync ( Fixture . NullValueExceptionType , async ( ) => await reader . GetFieldValueAsync < Stream > ( 0 ) ) ;
814
814
}
815
815
816
816
[ Fact ]
0 commit comments