@@ -31,7 +31,7 @@ public void SimpleTest()
3131 }
3232
3333
34- values = new [ ] { decimal . One / 3 , decimal . MinusOne / 3 } ;
34+ values = [ decimal . One / 3 , decimal . MinusOne / 3 ] ;
3535
3636 foreach ( var value in values )
3737 {
@@ -51,33 +51,28 @@ public void SimpleTest()
5151 [ Fact ]
5252 public void InsertSelectValueTest ( )
5353 {
54- DecimalTests ( new [ ]
55- {
54+ DecimalTests ( [
5655 0m , decimal . Zero ,
5756 decimal . One ,
5857 decimal . One / 2 , decimal . MinusOne ,
5958 decimal . MinusOne / 2
60- } , 38 , 15 ) ;
59+ ] , 38 , 15 ) ;
6160
62- DecimalTests ( new [ ]
63- {
61+ DecimalTests ( [
6462 decimal . MinValue , decimal . MaxValue
65- } , 38 , 0 ) ;
63+ ] , 38 , 0 ) ;
6664
67- DecimalTests ( new [ ]
68- {
69- decimal . One / 3 , decimal . MinusOne / 3
70- } , 38 , 28 ) ;
65+ DecimalTests ( [
66+ decimal . One / 3 , decimal . MinusOne / 3 , - 123456789.987654321m
67+ ] , 38 , 28 ) ;
7168
72- DecimalTests ( new [ ]
73- {
69+ DecimalTests ( [
7470 0.3333M , 56.1234M
75- } , 8 , 4 ) ;
71+ ] , 8 , 4 ) ;
7672
77- DecimalTests ( new [ ]
78- {
73+ DecimalTests ( [
7974 0.33M , 12.34M
80- } , 4 , 2 ) ;
75+ ] , 4 , 2 ) ;
8176
8277 void DecimalTests ( decimal [ ] values , int precision , int scale )
8378 {
@@ -118,7 +113,7 @@ public void InsertSelectValueTestWithCulture()
118113 {
119114 var defaultCulture = System . Threading . Thread . CurrentThread . CurrentCulture ;
120115
121- DecimalTests ( new [ ] { "fr-fr" , "en-us" } , decimal . One / 2 , 38 , 15 ) ;
116+ DecimalTests ( [ "fr-fr" , "en-us" ] , decimal . One / 2 , 38 , 15 ) ;
122117
123118 void DecimalTests ( string [ ] cultures , decimal value , int precision , int scale )
124119 {
@@ -155,4 +150,22 @@ void DecimalTests(string[] cultures, decimal value, int precision, int scale)
155150 System . Threading . Thread . CurrentThread . CurrentCulture = defaultCulture ;
156151 }
157152 }
153+
154+ [ Fact ]
155+ public void BindParameterWithoutTable ( )
156+ {
157+ decimal [ ] values = [ decimal . Zero , 0.00m , 123456789.987654321m , - 123456789.987654321m , 1.230m , - 1.23m ,
158+ 0.000000001m , - 0.000000001m , 1000000.000000001m , - 1000000.000000001m , 1.123456789012345678901m ] ;
159+
160+ foreach ( var value in values )
161+ {
162+ Command . CommandText = "SELECT ?;" ;
163+ Command . Parameters . Clear ( ) ;
164+ Command . Parameters . Add ( new DuckDBParameter ( value ) ) ;
165+
166+ var result = Command . ExecuteScalar ( ) ;
167+
168+ result . Should ( ) . BeOfType < decimal > ( ) . Subject . Should ( ) . Be ( value ) ;
169+ }
170+ }
158171}
0 commit comments