public void setAuthLinkTest() { OAuthDialog target = new OAuthDialog(); string authentication_link = "http://www.flickr.com"; target.setAuthLink(authentication_link); Assert.AreEqual(authentication_link, target.OAuthLink.Text); }
public void getAuthenticationDataTest() { OAuthDialog target = new OAuthDialog(); target.OAuthData.Text = "abc"; string expected = "abc"; string actual; actual = target.getAuthenticationData(); Assert.AreEqual(expected, actual); }
public void WarningMessageTest() { OAuthDialog target = new OAuthDialog(); string message = "Warning"; target.WarningMessage(message); }
public void OAuthDialogConstructorTest() { OAuthDialog target = new OAuthDialog(); Assert.IsNotNull(target); target.Close(); }
private void authorize(IOAuthDialog authDialog = null) { if (authDialog == null) authDialog = new OAuthDialog(); OAuthRequestToken rtoken = flickrHandle.OAuthGetRequestToken("oob"); String url = flickrHandle.OAuthCalculateAuthorizationUrl(rtoken.Token, AuthLevel.Delete); System.Diagnostics.Process.Start(url); authDialog.setAuthLink(url); if (authDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { try { String access_code = authDialog.getAuthenticationData(); OAuthAccessToken atoken = flickrHandle.OAuthGetAccessToken(rtoken, access_code); authToken = atoken.Token; } catch { authDialog.WarningMessage("Authentication failed"); } } }