Beispiel #1
0
 public static MockHttpClientBuilder AddBytesResponse(
     this MockHttpClientBuilder @this,
     Expression <Func <HttpRequestMessage, bool> > match,
     byte[] bytes)
 {
     return(@this.AddHttpMessage(match, BuildBytesResponseMessage(bytes)));
 }
Beispiel #2
0
 public static MockHttpClientBuilder AddJsonResponse(
     this MockHttpClientBuilder @this,
     Expression <Func <HttpRequestMessage, bool> > match,
     string json)
 {
     return(@this.AddHttpMessage(match, BuildJsonResponseMessage(json)));
 }
Beispiel #3
0
 public static MockHttpClientBuilder AddJsonResponse(
     this MockHttpClientBuilder @this,
     string requestUrl,
     string json)
 {
     return(@this.AddHttpMessage(requestUrl, BuildJsonResponseMessage(json)));
 }
Beispiel #4
0
 public static MockHttpClientBuilder AddBytesResponse(
     this MockHttpClientBuilder @this,
     string requestUrl,
     byte[] bytes)
 {
     return(@this.AddHttpMessage(requestUrl, BuildBytesResponseMessage(bytes)));
 }
Beispiel #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));
        }