@@ -170,6 +170,42 @@ module ToQueryParamsTests =
170170 let result = toQueryParams " id" ( box [| g1; g2 |]) stubClient
171171 result |> shouldEqual [ ( " id" , g1.ToString()); ( " id" , g2.ToString()) ]
172172
173+ [<Fact>]
174+ let ``toQueryParams handles float32 array`` () =
175+ let result = toQueryParams " v" ( box [| 1.5 f; 2.5 f |]) stubClient
176+ result |> shouldEqual [ ( " v" , " 1.5" ); ( " v" , " 2.5" ) ]
177+
178+ [<Fact>]
179+ let ``toQueryParams handles double array`` () =
180+ let result = toQueryParams " v" ( box [| 1.5 ; 2.5 |]) stubClient
181+ result |> shouldEqual [ ( " v" , " 1.5" ); ( " v" , " 2.5" ) ]
182+
183+ [<Fact>]
184+ let ``toQueryParams handles byte array as base64`` () =
185+ // byte[] is serialized via client.Serialize (JSON base64) with surrounding quotes trimmed
186+ let bytes = [| 72 uy; 101 uy; 108 uy; 108 uy; 111 uy |] // "Hello" in ASCII
187+ let expected = ( JsonSerializer.Serialize bytes) .Trim( '"' )
188+ let result = toQueryParams " data" ( box bytes) stubClient
189+ result |> shouldEqual [ ( " data" , expected) ]
190+
191+ [<Fact>]
192+ let ``toQueryParams skips None items in Option < string > array`` () =
193+ let values : Option < string >[] = [| Some " a" ; None; Some " c" |]
194+ let result = toQueryParams " q" ( box values) stubClient
195+ result |> shouldEqual [ ( " q" , " a" ); ( " q" , " c" ) ]
196+
197+ [<Fact>]
198+ let ``toQueryParams skips None items in Option < float32 > array`` () =
199+ let values : Option < float32 >[] = [| Some 1.5 f; None; Some 3.5 f |]
200+ let result = toQueryParams " v" ( box values) stubClient
201+ result |> shouldEqual [ ( " v" , " 1.5" ); ( " v" , " 3.5" ) ]
202+
203+ [<Fact>]
204+ let ``toQueryParams skips None items in Option < double > array`` () =
205+ let values : Option < double >[] = [| Some 1.5 ; None; Some 3.5 |]
206+ let result = toQueryParams " v" ( box values) stubClient
207+ result |> shouldEqual [ ( " v" , " 1.5" ); ( " v" , " 3.5" ) ]
208+
173209
174210module CombineUrlTests =
175211
0 commit comments