예제 #1
0
 public static Returns WhenGet(this StubHttpServer stubHttpServer, string pathAndQuery)
 => stubHttpServer.When(
     request => request.Method == HttpMethod.Get &&
     request.RequestUri.PathAndQuery == pathAndQuery);
예제 #2
0
 public static Returns WhenPut(this StubHttpServer stubHttpServer, string pathAndQuery, Func <string, bool> bodyExpression)
 => stubHttpServer.When(
     request => request.Method == HttpMethod.Put &&
     request.RequestUri.PathAndQuery == pathAndQuery &&
     bodyExpression(request.Content.ReadAsStringAsync().Result));