Exemple #1
0
 public void Stub(ApiExpectation expectation)
 {
     _expectations.Add(expectation);
 }
Exemple #2
0
 private 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();
 }
Exemple #3
0
 public void Stub(ApiExpectation expectation)
 {
     _expectations.Add(expectation);
 }