public void ProcessResultsForInvalidValueTest()
 {
     AccountRequestProcessor <Account> target = new AccountRequestProcessor <Account>();
     XElement twitterResponse = XElement.Parse(m_testInvalidValueQueryResponse);
     IList    actual          = target.ProcessResults(twitterResponse);
     var      acct            = actual.Cast <Account>().ToList().FirstOrDefault();
 }
        public void ProcessResults_Returns_Empty_Collection_When_Empty_Results()
        {
            var reqProc = new AccountRequestProcessor<Account> { BaseUrl = "https://api.twitter.com/1.1/" };

            var accts = reqProc.ProcessResults(string.Empty);

            Assert.AreEqual(0, accts.Count);
        }
        public void ProcessResultsForEndSessionTest()
        {
            AccountRequestProcessor <Account> target = new AccountRequestProcessor <Account>();
            XElement twitterResponse = XElement.Parse(m_testEndSessionResponse);
            IList    actual          = target.ProcessResults(twitterResponse);
            var      acct            = actual.Cast <Account>().ToList().FirstOrDefault();

            Assert.AreEqual("Logged out.", acct.EndSessionStatus.Error);
        }
        public void ProcessResultsForRateLimitStatusTest()
        {
            AccountRequestProcessor <Account> target = new AccountRequestProcessor <Account>();
            XElement twitterResponse = XElement.Parse(m_testRateLimitStatusQueryResponse);
            IList    actual          = target.ProcessResults(twitterResponse);
            var      acct            = actual.Cast <Account>().ToList().FirstOrDefault();

            Assert.AreEqual(100, acct.RateLimitStatus.HourlyLimit);
        }
        public void ProcessResultsForVerifyCredentialsTest()
        {
            AccountRequestProcessor <Account> target = new AccountRequestProcessor <Account>();
            XElement twitterResponse = XElement.Parse(m_testVerifyCredentialsQueryResponse);
            IList    actual          = target.ProcessResults(twitterResponse);
            var      acct            = actual.Cast <Account>().ToList().FirstOrDefault();

            Assert.AreEqual("Joe Mayo", acct.User.Name);
        }
示例#6
0
        public void ProcessResults_Returns_Empty_Collection_When_Empty_Results()
        {
            var reqProc = new AccountRequestProcessor <Account> {
                BaseUrl = "https://api.twitter.com/1.1/"
            };

            var accts = reqProc.ProcessResults(string.Empty);

            Assert.AreEqual(0, accts.Count);
        }
        public void ProcessResults_Handles_VerifyCredentials()
        {
            var target = new AccountRequestProcessor<Account> { Type = AccountType.VerifyCredentials };

            List<Account> actual = target.ProcessResults(TestVerifyCredentialsQueryResponse);

            var acct = actual.Cast<Account>().ToList().FirstOrDefault();
            Assert.IsNotNull(acct);
            Assert.AreEqual("Joe Mayo", acct.User.Name);
        }
示例#8
0
        public void ProcessResults_Handles_VerifyCredentials()
        {
            var target = new AccountRequestProcessor <Account> {
                Type = AccountType.VerifyCredentials
            };

            List <Account> actual = target.ProcessResults(TestVerifyCredentialsQueryResponse);

            var acct = actual.Cast <Account>().ToList().FirstOrDefault();

            Assert.IsNotNull(acct);
            Assert.AreEqual("Joe Mayo", acct.User.Name);
        }
示例#9
0
        public void ProcessResults_Retains_Original_Input_Parameters()
        {
            var acctReqProc = new AccountRequestProcessor <Account>
            {
                Type            = AccountType.VerifyCredentials,
                SkipStatus      = true,
                IncludeEntities = true
            };

            var accounts = acctReqProc.ProcessResults(TestVerifyCredentialsQueryResponse);

            Assert.IsNotNull(accounts);
            Assert.IsNotNull(accounts.SingleOrDefault());
            var account = accounts.Single();

            Assert.AreEqual(AccountType.VerifyCredentials, account.Type);
            Assert.IsTrue(account.SkipStatus);
            Assert.IsTrue(account.IncludeEntities);
        }
        public void ProcessResults_Retains_Original_Input_Parameters()
        {
            var acctReqProc = new AccountRequestProcessor<Account>
            {
                Type = AccountType.VerifyCredentials,
                SkipStatus = true,
                IncludeEntities = true
            };

            var accounts = acctReqProc.ProcessResults(TestVerifyCredentialsQueryResponse);

            Assert.IsNotNull(accounts);
            Assert.IsNotNull(accounts.SingleOrDefault());
            var account = accounts.Single();
            Assert.AreEqual(AccountType.VerifyCredentials, account.Type);
            Assert.IsTrue(account.SkipStatus);
            Assert.IsTrue(account.IncludeEntities);
        }
        public void ProcessResultsForVerifyCredentialsTest()
        {
            AccountRequestProcessor<Account> target = new AccountRequestProcessor<Account>();
            XElement twitterResponse = XElement.Parse(m_testVerifyCredentialsQueryResponse);
            IList actual = target.ProcessResults(twitterResponse);
            var acct = actual.Cast<Account>().ToList().FirstOrDefault();

            Assert.AreEqual("Joe Mayo", acct.User.Name);
        }
        public void ProcessResultsForRateLimitStatusTest()
        {
            AccountRequestProcessor<Account> target = new AccountRequestProcessor<Account>();
            XElement twitterResponse = XElement.Parse(m_testRateLimitStatusQueryResponse);
            IList actual = target.ProcessResults(twitterResponse);
            var acct = actual.Cast<Account>().ToList().FirstOrDefault();

            Assert.AreEqual(100, acct.RateLimitStatus.HourlyLimit);
        }
 public void ProcessResultsForInvalidValueTest()
 {
     AccountRequestProcessor<Account> target = new AccountRequestProcessor<Account>();
     XElement twitterResponse = XElement.Parse(m_testInvalidValueQueryResponse);
     IList actual = target.ProcessResults(twitterResponse);
     var acct = actual.Cast<Account>().ToList().FirstOrDefault();
 }
        public void ProcessResultsForEndSessionTest()
        {
            AccountRequestProcessor<Account> target = new AccountRequestProcessor<Account>();
            XElement twitterResponse = XElement.Parse(m_testEndSessionResponse);
            IList actual = target.ProcessResults(twitterResponse);
            var acct = actual.Cast<Account>().ToList().FirstOrDefault();

            Assert.AreEqual("Logged out.", acct.EndSessionStatus.Error);
        }