コード例 #1
0
ファイル: ManosBrowser.cs プロジェクト: vbatz258/manos
        public ManosBrowser(ManosApp app)
        {
            _app = app;
            _app.StartInternal ();

            Request = new MockHttpRequest ();
            Response = new MockHttpResponse ();
            Transaction = new MockHttpTransaction (Request, Response);
        }
コード例 #2
0
ファイル: RouteHandlerTest.cs プロジェクト: vbatz258/manos
        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);
        }
コード例 #3
0
ファイル: RouteHandlerTest.cs プロジェクト: vbatz258/manos
        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);
        }
コード例 #4
0
ファイル: RouteHandlerTest.cs プロジェクト: nuxleus/manos
        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);
        }