public override WebRequestExecutor CreateWebRequestExecutor(ClientRuntimeContext context, string requestUrl)
 {
     if (RunAsIntegrationTest)
     {
         ComposedWebRequestExecutor executor = new ComposedWebRequestExecutor(new SPWebRequestExecutor(context, requestUrl));
         executor.OnRequestExecuted += OnRequestExecuted;
         if (MockDataRepository != null)
         {
             executor.OnRequestExecuted += delegate(object sender, RequestExecutedArgs e)
             {
                 MockCreator.AddToMockResponse(e);
             };
         }
         return(executor);
     }
     return(new MockWebRequestExecutor(requestUrl, ResponseProvider));
 }
예제 #2
0
 public override WebRequestExecutor CreateWebRequestExecutor(ClientRuntimeContext context, string requestUrl)
 {
     if (RunAsIntegrationTest)
     {
         ComposedWebRequestExecutor executor = new ComposedWebRequestExecutor(new SPWebRequestExecutor(context, requestUrl));
         executor.OnRequestExecuted += OnRequestExecuted;
         executor.OnRequestExecuted += delegate(object sender, RequestExecutedArgs e)
         {
             IntegrationResponses.Add(new MockResponse()
             {
                 Body     = e.RequestBody,
                 Response = e.ResponseBody,
                 Verb     = "POST"
             });
         };
         return(executor);
     }
     return(new MockWebRequestExecutor(requestUrl, ResponseProvider));
 }