public ManosBrowser(ManosApp app) { _app = app; _app.StartInternal (); Request = new MockHttpRequest (); Response = new MockHttpResponse (); Transaction = new MockHttpTransaction (Request, Response); }
public void RouteWorksWithRegexParamsInModuleOnCustomApp() { var t = new TestApp(); var req = new MockHttpRequest(HttpMethod.HTTP_GET,"/TESTING/Route3/Andrew/29"); var txn = new MockHttpTransaction(req); t.HandleTransaction(t,txn); Assert.AreEqual("'Andrew', you are '29'",txn.ResponseString); req = new MockHttpRequest(HttpMethod.HTTP_GET,"/TESTING/Route3/Andrew/29/"); txn = new MockHttpTransaction(req); t.HandleTransaction(t,txn); Assert.AreEqual("'Andrew', you are '29'",txn.ResponseString); }
public void ImplicitRouteWorksWithModuleOnCustomApp() { var t = new TestApp(); var req = new MockHttpRequest(HttpMethod.HTTP_GET,"/TESTING/Route1"); var txn = new MockHttpTransaction(req); t.HandleTransaction(t,txn); Assert.AreEqual("Route1",txn.ResponseString); req = new MockHttpRequest(HttpMethod.HTTP_GET, "/TESTING/Route1/"); txn = new MockHttpTransaction(req); t.HandleTransaction(t,txn); Assert.AreEqual("Route1",txn.ResponseString); }
public void RouteWorksWithNamedParametersInModuleOnCustomApp() { var t = new TestApp(); var req = new MockHttpRequest(HttpMethod.HTTP_GET, "/TESTING/Route2a/29/Andrew"); var txn = new MockHttpTransaction(req, new MockHttpResponse()); t.HandleTransaction(t, txn); Assert.AreEqual("(R2a) Hello 'Andrew', you are '29'", txn.ResponseString); req = new MockHttpRequest(HttpMethod.HTTP_GET, "/TESTING/Route2b/Andrew/29"); txn = new MockHttpTransaction(req, new MockHttpResponse()); t.HandleTransaction(t, txn); Assert.AreEqual("(R2b) Hello 'Andrew', you are '29'", txn.ResponseString); }