コード例 #1
0
 /// <summary>
 /// Set the default mock session settings to modify request and responses.
 /// </summary>
 /// <param name="testSession"></param>
 public static void SetDefaultTestSessionSettings(HttpSession testSession)
 {
     testSession.ServiceBaseUri = MockServerHelper.CommonServiceBaseUri;
     testSession.SessionProperties["Servername"] = "myserver01";
     testSession.SessionProperties["Username"]   = "******";
     testSession.SessionProperties["Password"]   = "******";
     testSession.ResponseModifier =
         new Action <HttpMessage>(
             (message) =>
     {
         DatabaseTestHelper.FixODataResponseUri(
             message.ResponseInfo,
             testSession.ServiceBaseUri,
             MockHttpServer.DefaultServerPrefixUri);
     });
     testSession.RequestModifier =
         new Action <HttpMessage.Request>(
             (request) =>
     {
         DatabaseTestHelper.FixODataRequestPayload(
             request,
             testSession.ServiceBaseUri,
             MockHttpServer.DefaultServerPrefixUri);
     });
 }