Пример #1
0
        public void ExtractQueryString_must_return_formatted_string_when_parameters_are_valid()
        {
            NameValueCollection param = new NameValueCollection();
            param.Add("attr1", "10");
            param.Add("attr2", "20");

            APIClient target = new APIClient(new AuthState
            {
                AccessToken = "token",
                ApiUrl = "https://www.mystore.com/api/v1"
            });

            Assert.AreEqual("?attr1=10&attr2=20", target.ExtractQueryString(param));
        }
Пример #2
0
        public void ExtractQueryString_must_return_empty_when_parameters_are_null()
        {
            APIClient target = new APIClient(new AuthState
            {
                AccessToken = "token",
                ApiUrl = "https://www.mystore.com/api/v1"
            });

            Assert.AreEqual(String.Empty,target.ExtractQueryString(null));
        }