public void CanCallRequestHandler() { var testHarnessServer = new TestHarnessServer(); testHarnessServer.RegisterRequestHandler(ProcessRequest); var testHarness = new Adapter(this, testHarnessServer); var response = testHarness.Execute(new Request { Method = "GET" }); LastRequest().Method.Should().Be("GET"); response.AssertIsNotFound(); }
public void CanCallRequestHandler2() { var testHarnessServer = new TestHarnessServer(); testHarnessServer.RegisterRequestHandler(ProcessRequest); var testHarness = new Adapter(this, testHarnessServer); _nextResponse = new Response() { Status = 200 }; var response = testHarness.Execute(new Request { Method = "POST" }); LastRequest().Path.Should().Be("/"); LastRequest().Method.Should().Be("POST"); response.AssertIsOk(); }