コード例 #1
0
        public void TestHeadToTarget()
        {
            var m   = new MockManosModule();
            var req = new MockHttpRequest(HttpMethod.HTTP_HEAD, "/Foobar");

            m.Head("/Foobar", new ManosAction(FakeAction));
            Assert.AreEqual(new ManosAction(FakeAction), m.Routes.Find(req).Action);

            req = new MockHttpRequest(HttpMethod.HTTP_GET, "/Foobar");
            Assert.IsNull(m.Routes.Find(req));
        }
コード例 #2
0
        public void TestHeadToModule()
        {
            var m   = new MockManosModule();
            var req = new MockHttpRequest(HttpMethod.HTTP_HEAD, "/FakeModule/FakeAction");

            m.Head("/FakeModule", new FakeModule());

            //
            // I guess technically this is testing the auto name registering too
            //
            Assert.AreEqual(new ManosAction(FakeModule.FakeAction), m.Routes.Find(req).Action);

            req = new MockHttpRequest(HttpMethod.HTTP_GET, "/FakeModule/FakeAction");
            Assert.IsNull(m.Routes.Find(req));
        }
コード例 #3
0
ファイル: ManosModuleTest.cs プロジェクト: nuxleus/manos
        public void TestHeadToTarget()
        {
            var m = new MockManosModule();
            var req = new MockHttpRequest(HttpMethod.HTTP_HEAD, "/Foobar");

            m.Head("/Foobar", new ManosAction(FakeAction));
            Assert.AreEqual(new ManosAction(FakeAction), m.Routes.Find(req).Action);

            req = new MockHttpRequest(HttpMethod.HTTP_GET, "/Foobar");
            Assert.IsNull(m.Routes.Find(req));
        }
コード例 #4
0
ファイル: ManosModuleTest.cs プロジェクト: nuxleus/manos
        public void TestHeadToModule()
        {
            var m = new MockManosModule();
            var req = new MockHttpRequest(HttpMethod.HTTP_HEAD, "/FakeModule/FakeAction");

            m.Head("/FakeModule", new FakeModule());

            //
            // I guess technically this is testing the auto name registering too
            //
            Assert.AreEqual(new ManosAction(FakeModule.FakeAction), m.Routes.Find(req).Action);

            req = new MockHttpRequest(HttpMethod.HTTP_GET, "/FakeModule/FakeAction");
            Assert.IsNull(m.Routes.Find(req));
        }