public void EmptyFillNulls() { TokensPair pair = TokensPair.Empty; Assert.IsNull(pair.Token); Assert.IsNull(pair.TokenSecret); }
private void buttonOK_Click(object sender, EventArgs e) { var preCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; pair = lazyCureDriver.SetExternalPosterAuthorizationPin(this.textBoxPIN.Text); this.Cursor = preCursor; }
public void EmptyTokenIsInvalid() { TokensPair pair = new TokensPair("", "something"); Assert.False(pair.IsValid); }
/// <summary> /// Set pin and returns access tokens /// </summary> /// <param name="verifier">pin as a verifier</param> /// <returns>access TokensPair</returns> public TokensPair SetPin(string verifier) { if (string.IsNullOrWhiteSpace(verifier)) return TokensPair.Empty; if (requestTokenResponse == null) return TokensPair.Empty; if (string.IsNullOrWhiteSpace(requestTokenResponse.Token)) return TokensPair.Empty; try { accessTokenResponse = null; accessTokenResponse = OAuthUtility.GetAccessToken(consumerKey, consumerSecret, requestTokenResponse.Token, verifier); } catch (Exception ex) { Log.Exception(ex); } if (accessTokenResponse == null) return TokensPair.Empty; var accessTokensPair = new TokensPair(accessTokenResponse.Token, accessTokenResponse.TokenSecret); AccessTokens = accessTokensPair; return accessTokensPair; }
public void EmptyTokenIsInvalid() { TokensPair pair = new TokensPair("","something"); Assert.False(pair.IsValid); }