private LinkedInTokenInformation ExchangeRequestTokenForAccessTokenAndSecret(string requestToken, string requestSecret, string oauthVerifier)
 {
     if (SetLinkedInSubscription.IsTestHook(requestToken))
     {
         return(new LinkedInTokenInformation
         {
             Token = "***TEST_SET_ACCESS_TOKEN***",
             Secret = "***TEST_SET_ACCESS_TOKEN_SECRET***"
         });
     }
     return(this.CreateAuthenticator().GetAccessToken(requestToken, requestSecret, oauthVerifier));
 }
        private void RejectIfDifferentAccount(ConnectSubscriptionProxy proxy, string requestToken, string newAccessToken, string newAccessTokenSecret)
        {
            if (SetLinkedInSubscription.IsTestHook(requestToken))
            {
                return;
            }
            string emailAddress = new LinkedInWebClient(this.appConfig, SetLinkedInSubscription.Tracer).GetProfile(newAccessToken, newAccessTokenSecret, "email-address").EmailAddress;

            if (!string.Equals(proxy.UserId, emailAddress, StringComparison.Ordinal))
            {
                throw new CannotSwitchLinkedInAccountException();
            }
        }