public void GetPath_Request_CorrectPath()
        {
            var request = new RequestBase();

            var path = request.GetPath();

            Assert.Equal("MethodBlock/MethodName", path);
        }
Beispiel #2
0
        public virtual string GetResponseAsStringFor(RequestBase request)
        {
            var requestString = string.Format("https://{0}/{1}/{2}/?{3}",
                                              server,
                                              apiName,
                                              request.GetPath(),
                                              request.GetParametersLikeUri());

            var webClient = new WebClient();
            var response  = webClient.DownloadString(requestString);

            return(response);
        }
Beispiel #3
0
        public TResponse GetResponseFor <TResponse>(RequestBase request)
        {
            var requestString = string.Format("https://{0}/{1}/{2}/?{3}",
                                              server,
                                              apiName,
                                              request.GetPath(),
                                              request.GetParametersLikeUri());

            var webClient      = new WebClient();
            var responseString = webClient.DownloadString(requestString);

            var response = serializer.Deserialize <TResponse>(responseString);

            return(response);
        }