public void BuildUrl_WithNullParamDictionary_Throws()
        {
            var accActReqProc = new AccountActivityRequestProcessor <AccountActivity> {
                BaseUrl = "https://api.twitter.com/1.1/"
            };

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

            Assert.AreEqual("Type", ex.ParamName);
        }
        public void BuildUrl_WithMissingType_Throws()
        {
            var accActReqProc = new AccountActivityRequestProcessor <AccountActivity> {
                BaseUrl = "https://api.twitter.com/1.1/"
            };
            var parameters = new Dictionary <string, string>();

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

            Assert.AreEqual("Type", ex.ParamName);
        }
        public void BuildUrl_WithWebhooksType_ConstructsUrl()
        {
            var accActReqProc = new AccountActivityRequestProcessor <AccountActivity> {
                BaseUrl = "https://api.twitter.com/1.1/"
            };
            const string Expected   = "https://api.twitter.com/1.1/account_activity/webhooks.json";
            var          parameters =
                new Dictionary <string, string>
            {
                { "Type", ((int)AccountActivityType.Webhooks).ToString(CultureInfo.InvariantCulture) }
            };

            Request req = accActReqProc.BuildUrl(parameters);

            Assert.AreEqual(Expected, req.FullUrl);
        }
        public void BuildUrl_ForSubscriptionsWithoutWebhookID_Throws()
        {
            var accActReqProc = new AccountActivityRequestProcessor <AccountActivity> {
                BaseUrl = "https://api.twitter.com/1.1/"
            };
            var parameters =
                new Dictionary <string, string>
            {
                { "Type", ((int)AccountActivityType.Subscriptions).ToString(CultureInfo.InvariantCulture) },
                //{ "WebhookID", "478805447" },
            };

            ArgumentNullException ex = L2TAssert.Throws <ArgumentNullException>(() => accActReqProc.BuildUrl(parameters));

            Assert.AreEqual("WebhookID", ex.ParamName);
        }