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)
Exemplo n.º 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();
 }
Exemplo n.º 2
0
 public void Stub(ApiExpectation expectation)
 {
     _expectations.Add(expectation);
 }
Exemplo n.º 3
0
 public void Stub(ApiExpectation expectation)
 {
     _expectations.Add(expectation);
 }