20#include <boost/test/unit_test.hpp>
32 BOOST_CHECK( server.
GetRedirectUri().StartsWith( wxS(
"http://127.0.0.1:" ) ) );
33 BOOST_CHECK( server.
GetRedirectUri().EndsWith( wxS(
"/oauth/callback" ) ) );
42 wxS(
"GET /oauth/callback?code=abc&state=wrong HTTP/1.1" ),
43 wxS(
"/oauth/callback" ), wxS(
"expected-state" ), response, error );
46 BOOST_CHECK( error.Contains( wxString(
"state" ) ) );
55 wxS(
"GET /wrong/path?code=abc&state=expected-state HTTP/1.1" ),
56 wxS(
"/oauth/callback" ), wxS(
"expected-state" ), response, error );
59 BOOST_CHECK( error.Contains( wxString(
"callback path" ) ) );
68 wxS(
"GET /oauth/callback?state=expected-state HTTP/1.1" ),
69 wxS(
"/oauth/callback" ), wxS(
"expected-state" ), response, error );
72 BOOST_CHECK( error.Contains( wxString(
"authorization code" ) ) );
static bool ParseAuthorizationResponse(const wxString &aRequestLine, const wxString &aExpectedPath, const wxString &aExpectedState, OAUTH_AUTHORIZATION_RESPONSE &aResponse, wxString &aError)
wxString GetRedirectUri() const
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(RedirectUriUsesLoopback)