示例#1
0
 public static MockHttpClientBuilder AddBytesResponse(
     this MockHttpClientBuilder @this,
     Expression <Func <HttpRequestMessage, bool> > match,
     byte[] bytes)
 {
     return(@this.AddHttpMessage(match, BuildBytesResponseMessage(bytes)));
 }
示例#2
0
 public static MockHttpClientBuilder AddJsonResponse(
     this MockHttpClientBuilder @this,
     Expression <Func <HttpRequestMessage, bool> > match,
     string json)
 {
     return(@this.AddHttpMessage(match, BuildJsonResponseMessage(json)));
 }
示例#3
0
 public static MockHttpClientBuilder AddJsonResponse(
     this MockHttpClientBuilder @this,
     string requestUrl,
     string json)
 {
     return(@this.AddHttpMessage(requestUrl, BuildJsonResponseMessage(json)));
 }
示例#4
0
 public static MockHttpClientBuilder AddBytesResponse(
     this MockHttpClientBuilder @this,
     string requestUrl,
     byte[] bytes)
 {
     return(@this.AddHttpMessage(requestUrl, BuildBytesResponseMessage(bytes)));
 }
示例#5
0
        public static MockHttpClientBuilder AddStatusCodeResponse(
            this MockHttpClientBuilder @this,
            string requestUrl,
            HttpStatusCode httpStatusCode)
        {
            var httpStatusCodeResponse = HttpResponseMessageBuilder.New
                                         .WithHttpStatusCode(httpStatusCode)
                                         .Build();

            return(@this.AddHttpMessage(requestUrl, httpStatusCodeResponse));
        }