public void TwitterNET_Favorites_Tests_Setup()
        {
            twitter = new Twitter("apitest4769", "testaccount");

            //Ensure we're following the user we're testing favorites on
            if (!twitter.CheckFriendship("apitest4769", "mkoby"))
                twitter.FollowUser("mkoby", false);

            try
            {
                //Make sure the status we're going to
                //test with is NOT currently a favorite.
                DeleteFavoriteToTest();

            }
            catch(Exception ex)
            {
                Console.WriteLine("{0}\n\n{1}", ex.Message, ex.StackTrace);
            }
            finally
            {
                twitter.EndTwitterSession();
                twitter = null;
            }
        }
        public void TwitterNET_Tests_Setup()
        {
            twitter = new Twitter("apitest4769", "testaccount");

            //Ensure we're following the user we're testing device
            //notifications on
            if (!twitter.CheckFriendship("apitest4769", testUserName))
                twitter.FollowUser(testUserName, false);
        }
        public void TestFixture_Setup()
        {
            twitter = new Twitter("apitest4769", "testaccount");

            //Ensuring the environment is as we want it
            if(twitter.CheckFriendship("apitest4769", TestFollowUser))
            {
                twitter.UnfollowUser(TestFollowUser);
            }

            twitter = null;
        }
Пример #4
0
        public void TestFixture_TearDown()
        {
            //Reset the test environment,
            //Unblock & refollow test user

            twitter = new Twitter("apitest4769", "testaccount");

            if (twitter.IsBlocked(TestUserID))
                twitter.UnblockUser(TestUserID);

            if (!twitter.CheckFriendship("apitest4769", TestUserName))
                twitter.FollowUser(TestUserName, false);

            twitter = null;
        }
        public void TestFixture_Setup()
        {
            try
            {
                twitter = new Twitter("apitest4769", "testaccount");

                //Ensure we're following the user we'll need in some tests
                if (!twitter.CheckFriendship("apitest4769", "mkoby"))
                    twitter.FollowUser("mkoby", false);

                StatusRequestOptions statusRequestOptions = new StatusRequestOptions();
                statusRequestOptions.Add(StatusRequestOptionNames.Page, 3);
                statusRequestOptions.Add(StatusRequestOptionNames.ScreenName, TestUserName);
                IList<StatusMessage> friendsTimeline = twitter.GetUserTimeline(statusRequestOptions);

                if (friendsTimeline != null && friendsTimeline.Count > 0)
                {
                    minTestStatusID = friendsTimeline.Min(status => status.ID);
                    maxTestStatusID = friendsTimeline.Max(status => status.ID);
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }

            twitter = null;
        }