コード例 #1
0
ファイル: ShowUser.cs プロジェクト: sebagomez/twitterlib
        public static async Task <User> GetUser(UserShowOptions options)
        {
            CheckData(options);

            if (string.IsNullOrEmpty(options.UserId) && string.IsNullOrEmpty(options.ScreenName))
            {
                throw new Exception("You mst set either a screen name or a user id");
            }

            HttpRequestMessage reqMsg = OAuthHelper.GetRequest(HttpMethod.Get, SHOW_USER_URL, options);

            return(await GetData <User>(reqMsg));
        }
コード例 #2
0
        private async Task InternalGetUser(string screenname)
        {
            try
            {
                UserShowOptions options = new UserShowOptions {
                    ScreenName = screenname, User = m_user
                };
                User user = await Sebagomez.TwitterLib.API.Tweets.UserData.GetUser(options);

                Assert.True(user.screen_name == screenname, "OK");
            }
            catch (Exception ex)
            {
                Assert.True(false, Util.ExceptionMessage(ex));
            }
        }