You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried this implementation: "{{Random Type=\"Long\" Min=1000000000 Max=9999999999}}", but I am getting an error, even though 1000000000 and 9999999999 are valid Int64 numbers.
Is this handlebar expression correct? Or do we have a bug when generating Random long numbers?
Following are more details.
Implementation
varsettings=newWireMockServerSettings{AllowPartialMapping=true,StartAdminInterface=true,Urls=new[]{"http://localhost:3000/",},Logger=newWireMockConsoleLogger(),};varserver=StandAloneApp.Start(settings);server.Given(Request.Create().WithPath(newExactMatcher("/")).UsingGet()).RespondWith(Response.Create().WithStatusCode(200).WithHeader("Content-Type","application/json").WithBodyAsJson(new{id="{{Random Type=\"Long\" Min=1000000000 Max=9999999999}}",}).WithTransformer());Console.WriteLine("Press any key to stop the server");Console.ReadKey();
Response (error)
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Date: Fri, 08 Dec 2023 16:36:45 GMT
Server: Kestrel
Transfer-Encoding: chunked
{"Status":"Object of type 'System.String' cannot be converted to type 'System.Int64'."}
How to get a Random Long?
I tried this implementation:
"{{Random Type=\"Long\" Min=1000000000 Max=9999999999}}"
, but I am getting an error, even though1000000000
and9999999999
are valid Int64 numbers.Is this handlebar expression correct? Or do we have a bug when generating Random
long
numbers?Following are more details.
Implementation
Response (error)
Logs
Please, let me know if you need any other information.
Thanks.
The text was updated successfully, but these errors were encountered: