Example #1
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;
        }
Example #2
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;
        }
Example #3
0
 public void AddTestRequest(TestWebRequest testRequest)
 {
     TestWebRequests.Add(testRequest);
 }
Example #4
0
 public MockClient AddResponse(TestWebRequest testWebRequest)
 {
     _requestFactory.AddTestRequest(testWebRequest);
     return this;
 }