/// <summary>
        /// This method retrieves the authenicated user by creating a query for Twitter.
        ///
        /// Precondition: none
        /// Postcondition: none
        /// </summary>
        /// <returns></returns>
        public UserEntity GetAuthenticatedUser()
        {
            TwitterQuery twitterQuery = TwitterQuery.Create(TwitterConstants.AuthUserUrl);

            twitterQuery.AddParameter("skip_status", "true");
            twitterQuery.AddParameter("include_entities", "true");
            string     result = ExecuteQuery(twitterQuery);
            UserEntity user   = JsonHelper.DeserializeToClass <UserEntity>(result);

            return(user);
        }
Beispiel #2
0
        public void TestAddParamaterTwiceWithInt()
        {
            TwitterQuery q = TwitterQuery.Create("teststring");

            q.AddParameter("Keystring", 3);
            q.AddParameter("Keystring2", 4);

            List <KeyValuePair <string, string> > l = new List <KeyValuePair <string, string> >();

            l.Add(new KeyValuePair <string, string>("Keystring", "3"));
            l.Add(new KeyValuePair <string, string>("Keystring2", "4"));

            CollectionAssert.AreEqual(l, q.QueryParameterList);
            Assert.AreEqual("teststring?Keystring=3&Keystring2=4", q.QueryUrl);
        }
Beispiel #3
0
        public void TestAddParamaterWithStringAndDouble()
        {
            TwitterQuery q = TwitterQuery.Create("teststring");

            q.AddParameter("Keystring", 3.5);

            List <KeyValuePair <string, string> > l = new List <KeyValuePair <string, string> >();

            l.Add(new KeyValuePair <string, string>("Keystring", "3.5"));

            CollectionAssert.AreEqual(l, q.QueryParameterList);
            Assert.AreEqual("teststring?Keystring=3.5", q.QueryUrl);
        }