public static TestWebRequest CreateTestRequest(Regex requestUriRegex, string response, TimeSpan latency, Exception requestStreamException, Exception responseStreamException, Exception endGetResponseException)
        {
            var request = new TestWebRequest(response, latency, requestStreamException, responseStreamException, endGetResponseException);
            request.RequestUriRegex = requestUriRegex;
#if !SILVERLIGHT
            request.Timeout = Convert.ToInt32(TimeSpan.FromSeconds(30).TotalMilliseconds);
#else
            //FIXME: Need a way to timeout requests in Silverlight
#endif
            return request;
        }
        public TestWebRequest CreateTestRequest(string response, TimeSpan latency, Exception requestStreamException, Exception responseStreamException, Exception endGetResponseException)
        {
            var request = new TestWebRequest(response, latency, requestStreamException, responseStreamException, endGetResponseException);
#if !SILVERLIGHT
            request.Timeout = Convert.ToInt32(RequestTimeout.TotalMilliseconds);
#else
            //FIXME: Need a way to timeout requests in Silverlight
#endif
            NextRequest = request;
            return request;
        }
示例#3
0
        public static TestWebRequest CreateTestRequest(Regex requestUriRegex, string response, TimeSpan latency, Exception requestStreamException, Exception responseStreamException, Exception endGetResponseException)
        {
            var request = new TestWebRequest(response, latency, requestStreamException, responseStreamException, endGetResponseException);

            request.RequestUriRegex = requestUriRegex;
#if !SILVERLIGHT
            request.Timeout = Convert.ToInt32(TimeSpan.FromSeconds(30).TotalMilliseconds);
#else
            //FIXME: Need a way to timeout requests in Silverlight
#endif
            return(request);
        }
示例#4
0
        public TestWebRequest CreateTestRequest(string response, TimeSpan latency, Exception requestStreamException, Exception responseStreamException, Exception endGetResponseException)
        {
            var request = new TestWebRequest(response, latency, requestStreamException, responseStreamException, endGetResponseException);

#if !SILVERLIGHT
            request.Timeout = Convert.ToInt32(RequestTimeout.TotalMilliseconds);
#else
            //FIXME: Need a way to timeout requests in Silverlight
#endif
            NextRequest = request;
            return(request);
        }
 public void AddTestRequest(TestWebRequest testRequest)
 {
     TestWebRequests.Add(testRequest);
 }
示例#6
0
 public void AddTestRequest(TestWebRequest testRequest)
 {
     TestWebRequests.Add(testRequest);
 }
示例#7
0
 public MockClient AddResponse(TestWebRequest testWebRequest)
 {
     _requestFactory.AddTestRequest(testWebRequest);
     return this;
 }