forked from organicmaps/organicmaps
Improved tests for OSM OAuth2 URI parsing
Signed-off-by: Sergiy Kozyr <s.trump@gmail.com>
This commit is contained in:
parent
9081d45d9a
commit
8edf155970
1 changed files with 13 additions and 3 deletions
|
@ -476,9 +476,19 @@ UNIT_TEST(AppNameTest)
|
|||
|
||||
UNIT_TEST(OAuth2Test)
|
||||
{
|
||||
ParsedMapApi api("om://oauth2/osm/callback?code=THE_MEGA_CODE");
|
||||
TEST_EQUAL(api.GetRequestType(), UrlType::OAuth2, ());
|
||||
TEST_EQUAL(api.GetOAuth2Code(), "THE_MEGA_CODE", ());
|
||||
{
|
||||
ParsedMapApi api("om://oauth2/osm/callback?code=THE_MEGA_CODE");
|
||||
TEST_EQUAL(api.GetRequestType(), UrlType::OAuth2, ());
|
||||
TEST_EQUAL(api.GetOAuth2Code(), "THE_MEGA_CODE", ());
|
||||
}
|
||||
{
|
||||
ParsedMapApi api("om://oauth2/google/callback?code=THE_MEGA_CODE");
|
||||
TEST_EQUAL(api.GetRequestType(), UrlType::Incorrect, ());
|
||||
}
|
||||
{
|
||||
ParsedMapApi api("om://oauth2/osm/callback?code=");
|
||||
TEST_EQUAL(api.GetRequestType(), UrlType::Incorrect, ());
|
||||
}
|
||||
}
|
||||
|
||||
namespace
|
||||
|
|
Loading…
Add table
Reference in a new issue