File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 1- using System . Collections . Generic ;
2- using System . Diagnostics . CodeAnalysis ;
3- using System . Linq ;
4- using Dapper ;
1+ using Dapper ;
52using DuckDB . NET . Data ;
63using FluentAssertions ;
4+ using System . Collections . Generic ;
5+ using System . Diagnostics . CodeAnalysis ;
6+ using System . Linq ;
77using Xunit ;
88
99namespace DuckDB . NET . Test ;
@@ -34,7 +34,9 @@ public void RegisterTableFunctionWithOneParameter()
3434 [ Fact ]
3535 public void RegisterTableFunctionWithOneParameterTwoColumns ( )
3636 {
37- Connection . RegisterTableFunction < int > ( "demo" , ( parameters ) =>
37+ var count = 3000 ;
38+
39+ Connection . RegisterTableFunction < int > ( "demo2" , ( parameters ) =>
3840 {
3941 var value = parameters . ElementAt ( 0 ) . GetValue < int > ( ) ;
4042
@@ -49,9 +51,9 @@ public void RegisterTableFunctionWithOneParameterTwoColumns()
4951 writers [ 1 ] . WriteValue ( $ "string{ item } ", rowIndex ) ;
5052 } ) ;
5153
52- var data = Connection . Query < ( int , string ) > ( "SELECT * FROM demo(3000 );" ) . ToList ( ) ;
54+ var data = Connection . Query < ( int , string ) > ( $ "SELECT * FROM demo2( { count } );") . ToList ( ) ;
5355
54- data . Select ( tuple => tuple . Item1 ) . Should ( ) . BeEquivalentTo ( Enumerable . Range ( 0 , 3000 ) ) ;
55- data . Select ( tuple => tuple . Item2 ) . Should ( ) . BeEquivalentTo ( Enumerable . Range ( 0 , 3000 ) . Select ( i => $ "string{ i } ") ) ;
56+ data . Select ( tuple => tuple . Item1 ) . Should ( ) . BeEquivalentTo ( Enumerable . Range ( 0 , count ) ) ;
57+ data . Select ( tuple => tuple . Item2 ) . Should ( ) . BeEquivalentTo ( Enumerable . Range ( 0 , count ) . Select ( i => $ "string{ i } ") ) ;
5658 }
5759}
You can’t perform that action at this time.
0 commit comments