public void OAuthShowUser() { TwitterOAuth tweet = new TwitterOAuth(TestConstants.TWITTER_CONSUMER_KEY, TestConstants.TWITTER_CONSUMER_SECRET); try { var response = tweet.ShowUser(TestConstants.TWITTER_ACCESS_TOKEN, TestConstants.TWITTER_ACCESS_SECRET, TestConstants.TWITTER_USERNAME_READ); Assert.AreEqual(TestConstants.TWITTER_USERNAME_READ, response.ScreenName); Console.WriteLine(response.ToJson()); } catch (WebException ex) { Console.Error.WriteLine(Util.HandleWebException(ex)); Assert.Fail(); } }
public void OAuthShowUserLargeFriendCount() { TwitterOAuth tweet = new TwitterOAuth(TestConstants.TWITTER_CONSUMER_KEY, TestConstants.TWITTER_CONSUMER_SECRET); try { var response = tweet.ShowUser(TestConstants.TWITTER_ACCESS_TOKEN, TestConstants.TWITTER_ACCESS_SECRET, "heatxsink"); Assert.AreEqual("heatxsink", response.ScreenName); Console.WriteLine(response.ToJson()); } catch (WebException ex) { Console.Error.WriteLine(Util.HandleWebException(ex)); } }
public void OAuthSendDirectMessageWithId() { TwitterOAuth tweet = new TwitterOAuth(TestConstants.TWITTER_CONSUMER_KEY, TestConstants.TWITTER_CONSUMER_SECRET); try { var text = "Hi, this is a direct message."; var user = tweet.ShowUser(TestConstants.TWITTER_ACCESS_TOKEN, TestConstants.TWITTER_ACCESS_SECRET, TestConstants.TWITTER_USERNAME_READ); var response = tweet.SendDirectMessage(TestConstants.TWITTER_ACCESS_TOKEN, TestConstants.TWITTER_ACCESS_SECRET, user.Id, text); Assert.AreEqual(text, response.Text); Console.WriteLine("{0}", response.Text); Console.WriteLine(response.ToJson()); } catch (WebException ex) { Console.Error.WriteLine(Util.HandleWebException(ex)); Assert.Fail(); } }