@@ -63,7 +63,8 @@ public void TestArrayBind()
6363 }
6464
6565 [ Test ]
66- public void TestBindNullValue ( )
66+ [ TestCaseSource ( nameof ( NullTestCases ) ) ]
67+ public void TestBindNullValue ( object nullValue )
6768 {
6869 using ( SnowflakeDbConnection dbConnection = new SnowflakeDbConnection ( ) )
6970 {
@@ -154,7 +155,7 @@ public void TestBindNullValue()
154155 if ( isTypeSupported )
155156 {
156157 command . CommandText = $ "insert into { TableName } ({ colName } ) values(:p0)";
157- param . Value = DBNull . Value ;
158+ param . Value = nullValue ;
158159 command . Parameters . Add ( param ) ;
159160 int rowsInserted = command . ExecuteNonQuery ( ) ;
160161 Assert . AreEqual ( 1 , rowsInserted ) ;
@@ -164,7 +165,7 @@ public void TestBindNullValue()
164165 try
165166 {
166167 command . CommandText = $ "insert into { TableName } (stringData) values(:p0)";
167- param . Value = DBNull . Value ;
168+ param . Value = nullValue ;
168169 command . Parameters . Add ( param ) ;
169170 int rowsInserted = command . ExecuteNonQuery ( ) ;
170171 }
@@ -199,6 +200,9 @@ public void TestBindNullValue()
199200 }
200201 }
201202
203+ private static IEnumerable < object > NullTestCases ( ) =>
204+ new object [ ] { DBNull . Value , null } ;
205+
202206 [ Test ]
203207 public void TestBindValue ( )
204208 {
0 commit comments