Пример #1
0
        public void BuildUrl_Throws_With_Null_Parameters()
        {
            var acctReqProc = new AccountRequestProcessor <Account> {
                BaseUrl = "https://api.twitter.com/1.1/"
            };

            var ex = L2TAssert.Throws <ArgumentException>(() => acctReqProc.BuildUrl(null));

            Assert.AreEqual("Type", ex.ParamName);
        }
Пример #2
0
        public void BuildUrl_Throws_When_Type_Not_Provided()
        {
            var acctReqProc = new AccountRequestProcessor <Account> {
                BaseUrl = "https://api.twitter.com/1.1/"
            };
            var parameters = new Dictionary <string, string>();

            var ex = L2TAssert.Throws <ArgumentException>(() => acctReqProc.BuildUrl(parameters));

            Assert.AreEqual("Type", ex.ParamName);
        }
Пример #3
0
        public void BuildUrl_Returns_Settings_Url()
        {
            const string ExpectedUrl = "https://api.twitter.com/1.1/account/settings.json";
            var          acctReqProc = new AccountRequestProcessor <Account> {
                BaseUrl = "https://api.twitter.com/1.1/"
            };
            var parameters = new Dictionary <string, string>
            {
                { "Type", ((int)AccountType.Settings).ToString(CultureInfo.InvariantCulture) }
            };

            Request req = acctReqProc.BuildUrl(parameters);

            Assert.AreEqual(ExpectedUrl, req.FullUrl);
        }
        public void BuildUrl_Constructs_VerifyCredentials_Url()
        {
            const string ExpectedUrl = "https://api.twitter.com/1.1/account/verify_credentials.json?skip_status=true&include_entities=false";
            var          acctReqProc = new AccountRequestProcessor <Account> {
                BaseUrl = "https://api.twitter.com/1.1/"
            };
            var parameters =
                new Dictionary <string, string>
            {
                { "Type", ((int)AccountType.VerifyCredentials).ToString(CultureInfo.InvariantCulture) },
                { "SkipStatus", true.ToString() },
                { "IncludeEntities", false.ToString() }
            };

            Request req = acctReqProc.BuildUrl(parameters);

            Assert.AreEqual(ExpectedUrl, req.FullUrl);
        }
        public void BuildUrl_Throws_With_Null_Parameters()
        {
            var acctReqProc = new AccountRequestProcessor<Account> { BaseUrl = "https://api.twitter.com/1.1/" };

            var ex = L2TAssert.Throws<ArgumentException>(() => acctReqProc.BuildUrl(null));

            Assert.AreEqual("Type", ex.ParamName);
        }
        public void BuildUrl_Throws_When_Type_Not_Provided()
        {
            var acctReqProc = new AccountRequestProcessor<Account> { BaseUrl = "https://api.twitter.com/1.1/" };
            var parameters = new Dictionary<string, string>();

            var ex = L2TAssert.Throws<ArgumentException>(() => acctReqProc.BuildUrl(parameters));

            Assert.AreEqual("Type", ex.ParamName);
        }
        public void BuildUrl_Returns_Settings_Url()
        {
            const string ExpectedUrl = "https://api.twitter.com/1.1/account/settings.json";
            var acctReqProc = new AccountRequestProcessor<Account> { BaseUrl = "https://api.twitter.com/1.1/" };
            var parameters = new Dictionary<string, string>
                {
                        { "Type", ((int)AccountType.Settings).ToString(CultureInfo.InvariantCulture) }
                };

            Request req = acctReqProc.BuildUrl(parameters);

            Assert.AreEqual(ExpectedUrl, req.FullUrl);
        }
        public void BuildUrl_Constructs_VerifyCredentials_Url()
        {
            const string ExpectedUrl = "https://api.twitter.com/1.1/account/verify_credentials.json?skip_status=true&include_entities=false";
            var acctReqProc = new AccountRequestProcessor<Account> { BaseUrl = "https://api.twitter.com/1.1/" };
            var parameters =
                new Dictionary<string, string>
                {
                        { "Type", ((int)AccountType.VerifyCredentials).ToString(CultureInfo.InvariantCulture) },
                        { "SkipStatus", true.ToString() },
                        { "IncludeEntities", false.ToString() }
                };

            Request req = acctReqProc.BuildUrl(parameters);

            Assert.AreEqual(ExpectedUrl, req.FullUrl);
        }