Exemplo n.º 1
0
        public ManosBrowser(ManosApp app)
        {
            _app = app;
            _app.StartInternal ();

            Request = new MockHttpRequest ();
            Response = new MockHttpResponse ();
            Transaction = new MockHttpTransaction (Request, Response);
        }
Exemplo n.º 2
0
        public MockHttpTransaction(IHttpRequest request)
        {
            if (request == null)
               throw new ArgumentNullException ("request");

            Request = request;

            Response = new MockHttpResponse (this);
        }
Exemplo n.º 3
0
        public void RouteWorksWithRegexParamsInModuleOnCustomApp()
        {
            var t = new TestApp();
            var req = new MockHttpRequest(HttpMethod.HTTP_GET, "/TESTING/Route3/Andrew/29");
            var res = new MockHttpResponse();
            var txn = new MockHttpTransaction(req, new MockHttpResponse());
            t.HandleTransaction(t, txn);

            Assert.AreEqual("'Andrew', you are '29'", txn.ResponseString);

            var t2 = new TestApp();
            var req2 = new MockHttpRequest(HttpMethod.HTTP_GET, "/TESTING/Route3/Andrew/29/");
            var res2 = new MockHttpResponse();
            var txn2 = new MockHttpTransaction(req2, res2);
            t2.HandleTransaction(t2, txn2);

            Assert.AreEqual("'Andrew', you are '29'", txn2.ResponseString);
        }