All of these default to safe values, the most interesting of which is a null response will act as an echo server (return the request)
示例#1
0
 private static void SendResponse(HttpListenerContext context, string body, ApiExpectation expectation)
 {
     var response = context.Response;
      response.StatusCode = expectation.Status ?? 200;
      response.ContentLength64 = (expectation.Response ?? body).Length;
      using (var sw = new StreamWriter(response.OutputStream))
      {
     sw.Write(expectation.Response ?? body);
      }
      response.Close();
 }
示例#2
0
 public void Stub(ApiExpectation expectation)
 {
     _expectations.Add(expectation);
 }
示例#3
0
 public void Stub(ApiExpectation expectation)
 {
     _expectations.Add(expectation);
 }