Skip to content

Commit 2efb473

Browse files
committed
Fix expected exception type.
1 parent 04efd32 commit 2efb473

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/AdoNet.Specification.Tests/DataReaderTestBase.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ public virtual void GetTextReader_throws_for_null_String()
718718
command.CommandText = Fixture.CreateSelectSql(DbType.String, ValueKind.Null);
719719
using var reader = command.ExecuteReader();
720720
reader.Read();
721-
Assert.Throws<InvalidCastException>(() => reader.GetTextReader(0));
721+
Assert.Throws(Fixture.NullValueExceptionType, () => reader.GetTextReader(0));
722722
}
723723

724724
[Fact]
@@ -753,7 +753,7 @@ public virtual void GetFieldValue_for_TextReader_throws_for_null_String()
753753
command.CommandText = Fixture.CreateSelectSql(DbType.String, ValueKind.Null);
754754
using var reader = command.ExecuteReader();
755755
reader.Read();
756-
Assert.Throws<InvalidCastException>(() => reader.GetFieldValue<TextReader>(0));
756+
Assert.Throws(Fixture.NullValueExceptionType, () => reader.GetFieldValue<TextReader>(0));
757757
}
758758

759759
[Fact]
@@ -764,7 +764,7 @@ public virtual async Task GetFieldValueAsync_for_TextReader_throws_for_null_Stri
764764
command.CommandText = Fixture.CreateSelectSql(DbType.String, ValueKind.Null);
765765
using var reader = await command.ExecuteReaderAsync();
766766
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));
768768
}
769769

770770
[Fact]
@@ -799,7 +799,7 @@ public virtual void GetFieldValue_for_Stream_throws_for_null_Binary()
799799
command.CommandText = Fixture.CreateSelectSql(DbType.Binary, ValueKind.Null);
800800
using var reader = command.ExecuteReader();
801801
reader.Read();
802-
Assert.Throws<InvalidCastException>(() => reader.GetFieldValue<Stream>(0));
802+
Assert.Throws(Fixture.NullValueExceptionType, () => reader.GetFieldValue<Stream>(0));
803803
}
804804

805805
[Fact]
@@ -810,7 +810,7 @@ public virtual async Task GetFieldValueAsync_for_Stream_throws_for_null_Binary()
810810
command.CommandText = Fixture.CreateSelectSql(DbType.Binary, ValueKind.Null);
811811
using var reader = await command.ExecuteReaderAsync();
812812
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));
814814
}
815815

816816
[Fact]

0 commit comments

Comments
 (0)