Add a unit test for wxWebRequest query using URL parameters

Check that passing URL parameters in the query string works as expected
(this was broken with WinHTTP backend until the parent commit).
This commit is contained in:
Vadim Zeitlin 2021-03-06 12:11:59 +01:00
parent a6c9fd2603
commit 59a8f26b01

View File

@ -212,6 +212,21 @@ TEST_CASE_METHOD(RequestFixture,
CHECK( request.GetResponse().AsString() == "The quick brown fox jumps over the lazy dog" );
}
TEST_CASE_METHOD(RequestFixture,
"WebRequest::Get::Param", "[net][webrequest][get]")
{
if ( !InitBaseURL() )
return;
Create("/get?pi=3.14159265358979323");
Run();
// We ought to really parse the returned JSON object, but to keep things as
// simple as possible for now we just treat it as a string.
CHECK_THAT( request.GetResponse().AsString().ToStdString(),
Catch::Contains("\"pi\": \"3.14159265358979323\"") );
}
TEST_CASE_METHOD(RequestFixture,
"WebRequest::Get::File", "[net][webrequest][get]")
{